[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] usb: Un-deprecate -usbdevice (except for -usbdevice audio
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v2] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) |
Date: |
Wed, 10 Mar 2021 14:17:48 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Thomas Huth <thuth@redhat.com> writes:
> When trying to remove the -usbdevice option, there were complaints that
> "-usbdevice braille" is still a very useful shortcut for some people.
Pointer? I missed it.
> Thus we never remove this option. Since it's not such a big burden to
> keep it around, and it's also convenient in the sense that you don't
> have to worry to enable a host controller explicitly with this option,
> we should remove it from he deprecation list again, and rather properly
> document the possible device for this option instead.
>
> However, there is one exception: "-usbdevice audio" should go away, since
> audio devices without "audiodev=..." parameter are also on the deprecation
> list and you cannot use "-usbdevice audio" with "audiodev".
>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
To be frank, I don't like this. At all.
-usbdevice comes with its own ad hoc mini-language, parsed by
usbdevice_create(). Syntax is DRIVER[:PARAMS], where PARAMS defaults to
"" and is parsed by an optional DRIVER-specific LegacyUSBFactory.
We already dropped multiple drivers: "host", "serial", "disk", "net"
(commit 99761176e, v2.12), and "bt" (commit 43d68d0a9, v5.0).
We've kept "audio" (dropped in this patch), "tablet", "mouse",
"keyboard", "braille", "ccid", and "wacom-tablet". Only "mouse",
"tablet", "braille" are documented (fixed in this patch).
One more has crept in: "u2f-key" (commit bb014a810, v5.2). It's buggy:
$ qemu-system-x86_64 -S -usbdevice u2f-key
qemu-system-x86_64: -usbdevice u2f-key: '-usbdevice' is deprecated, please
use '-device usb-...' instead
**
ERROR:../qom/object.c:508:object_initialize_with_type: assertion failed:
(type->abstract == false)
Bail out! ERROR:../qom/object.c:508:object_initialize_with_type: assertion
failed: (type->abstract == false)
Aborted (core dumped)
Broken right in the commit that added the stuff. The sugar never
worked, and should be taken out again.
Without a factory, "-usbdevice BAR" is sugar for
-device BAZ -machine usb=on
"braille" is the only driver with a factory. "-usbdevice braille" is
sugar for
-device usb-braille,chardev=braille -chardev braille,id=braille
-machine usb=on
It's buggy:
$ qemu-system-x86_64 -S -usbdevice braille
qemu-system-x86_64: -usbdevice braille: '-usbdevice' is deprecated, please
use '-device usb-...' instead
[three seconds tick by...]
Segmentation fault (core dumped)
It neglects to actually parse PARAMS:
$ qemu-system-x86_64 -S -usbdevice braille:"I'm a Little Teapot"
qemu-system-x86_64: -usbdevice braille:I'm a Little Teapot: '-usbdevice' is
deprecated, please use '-device usb-...' instead
[three seconds tick by...]
Segmentation fault (core dumped)
The whole machinery in support of optional PARAMS has long become
useless.
I fail to see why we could drop the sugar for serial, disk, net and host
devices, but not for the others.
The only one that has something approaching a leg to stand on is
braille. Still, I fail to see why having to specify a backend is fine
for any number of other devices, but not for braille.
Does QEMU really need more ways to do the same things? Underdocumented
and undertested ways.
Let's drop -usbdevice as planned.
If users need more time, we can extend the grace period.