Skip to contentSkip to conversation

Deprecated option -usbdevice in QEMU

DISCUSSION Anthony PERARD 3 participants 3 messages Mar 14, 2018 – Mar 22, 2018

lore
Share & tools
lore
#0 lore raw

Hi,

In an xl guest config, we have the "usbdevice" option. It is just passthrough to QEMU "-usbdevice" without parsing. The QEMU option is now deprecated. v2.11 (to be released with Xen 4.11) is the last version of QEMU to have the option.

Unfortunatly, our documentation relie on QEMU's documentation, so there would be a lot to parse if we want to keep the option.

I propose that we also deprecated the "usbdevice" option and find a suitable alternative (or we have to parse usbdevice in libxl).

"usbdev" seems to be a good fit for that, and should already handle "usbdevice='host:bus.addr', but would be written:
"usbdev=['type=hostdev,hostbus=bus,hostaddr=addr']"

The other use of "usbdevice" documented on the man are:
- tablet
- host:vendor_id:product_id

Other usage of "usbdevice" documented in the QEMU documentation:
- mouse
- disk:[format=format]:file
- serial:[vendorid=vendor_id][,productid=product_id]:dev
- braille
- net:options

From QEMU perspective, those options can be replaced the following cmdline options or QMP command equivalent (I haven't check everything):
* -device usb-tablet
* -device usb-host,vendorid=vendor,productid=product
* -device usb-mouse
* -drive if=none,id=drive_id,file=file -device usb-storage,drive=drive_id
* -chardev x,id=id -device usb-serial,chardev=id
* -device usb-braille
* -netdev x,id=id -device usb-net,netdev=id

How the original "usbdevice" could be translated into a USBDEV_SPEC for "usbdev" ? Maybe for e.g.:
'type=tablet'
'type=storage,file=file,format=format'

I don't know is anybody would be using "usbdevice='net:...'" or "usbdevice='serial:...'".

What do you think?

Thanks,

Signature · 6 lines
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

Adding Pasi, as he often has an interest in this sort of question.

Quoted 9 lines · Anthony PERARD

Hi,

In an xl guest config, we have the "usbdevice" option. It is just passthrough to QEMU "-usbdevice" without parsing. The QEMU option is now deprecated. v2.11 (to be released with Xen 4.11) is the last version of QEMU to have the option.

Unfortunatly, our documentation relie on QEMU's documentation, so there would be a lot to parse if we want to keep the option.

Serves us right for exposing a deprecated interface. :-/

Quoted 2 lines

I propose that we also deprecated the "usbdevice" option and find a suitable alternative (or we have to parse usbdevice in libxl).

qemu-traditional will continue to work as always, right? So people who really want to use something like this can specify qemu-traditional.

That said, looking around the web, there are really only a handful of examples people used for this; basically tablet and host passthrough. It wouldn't be hard to parse a very limited subset of options and convert them into more modern variants. I think even if the *only* thing we supported was "usbdevice=tablet", we'd make our users' lives a lot easier.

Quoted 32 lines

"usbdev" seems to be a good fit for that, and should already handle "usbdevice='host:bus.addr', but would be written:
"usbdev=['type=hostdev,hostbus=bus,hostaddr=addr']"

The other use of "usbdevice" documented on the man are:
- tablet
- host:vendor_id:product_id

Other usage of "usbdevice" documented in the QEMU documentation:
- mouse
- disk:[format=format]:file
- serial:[vendorid=vendor_id][,productid=product_id]:dev
- braille
- net:options

From QEMU perspective, those options can be replaced the following cmdline options or QMP command equivalent (I haven't check everything):
* -device usb-tablet
* -device usb-host,vendorid=vendor,productid=product
* -device usb-mouse
* -drive if=none,id=drive_id,file=file -device usb-storage,drive=drive_id
* -chardev x,id=id -device usb-serial,chardev=id
* -device usb-braille
* -netdev x,id=id -device usb-net,netdev=id

How the original "usbdevice" could be translated into a USBDEV_SPEC for "usbdev" ? Maybe for e.g.:
'type=tablet'
'type=storage,file=file,format=format'

Quoted 4 lines

I don't know is anybody would be using "usbdevice='net:...'" or "usbdevice='serial:...'".

What do you think?

I definitely think we should add "type=tablet" to "usbdev". The other ones are a nice-to-have that I wouldn't make a priority, with "USB storage" probably being the nicest-to-have.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
In reply to Anthony PERARD
Quoted 7 lines · Anthony PERARD

Hi,

In an xl guest config, we have the "usbdevice" option. It is just passthrough to QEMU "-usbdevice" without parsing. The QEMU option is now deprecated. v2.11 (to be released with Xen 4.11) is the last version of QEMU to have the option.

Quoted 5 lines

Unfortunatly, our documentation relie on QEMU's documentation, so there would be a lot to parse if we want to keep the option.

I propose that we also deprecated the "usbdevice" option and find a suitable alternative (or we have to parse usbdevice in libxl).

If we want to be backward compatible we need to parse the string anyway, regardless of whatever new thing we recommend, right?

Quoted 33 lines

"usbdev" seems to be a good fit for that, and should already handle "usbdevice='host:bus.addr', but would be written:
"usbdev=['type=hostdev,hostbus=bus,hostaddr=addr']"

The other use of "usbdevice" documented on the man are:
- tablet
- host:vendor_id:product_id

Other usage of "usbdevice" documented in the QEMU documentation:
- mouse
- disk:[format=format]:file
- serial:[vendorid=vendor_id][,productid=product_id]:dev
- braille
- net:options

From QEMU perspective, those options can be replaced the following cmdline options or QMP command equivalent (I haven't check everything):
* -device usb-tablet
* -device usb-host,vendorid=vendor,productid=product
* -device usb-mouse
* -drive if=none,id=drive_id,file=file -device usb-storage,drive=drive_id
* -chardev x,id=id -device usb-serial,chardev=id
* -device usb-braille
* -netdev x,id=id -device usb-net,netdev=id

How the original "usbdevice" could be translated into a USBDEV_SPEC for "usbdev" ? Maybe for e.g.:
'type=tablet'
'type=storage,file=file,format=format'

Quoted 4 lines

I don't know is anybody would be using "usbdevice='net:...'" or "usbdevice='serial:...'".

What do you think?

I would be fine with restricting usage to a few known devices and reject the rest. There is already a kitchen sink device_model_args that we can turn to.

Wei.

Quoted 5 lines

Thanks,

Signature · 1 line
Anthony PERARD

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel