qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] usb: Un-deprecate -usbdevice (except for -usbdevice audio


From: Thomas Huth
Subject: Re: [PATCH v2] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
Date: Wed, 10 Mar 2021 17:06:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 10/03/2021 14.17, Markus Armbruster wrote:
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.

Oh, there is still parameter parsing code left? I thought we'd remove it after removing the other legacy devices that actually took parameters... so yes, at least the parameter-related code in usbdevice_create() should go away, too.

We already dropped multiple drivers: "host", "serial", "disk", "net"
(commit 99761176e, v2.12), and "bt" (commit 43d68d0a9, v5.0).

Right, these were the really ugly ones that used their own parameter parsing code.

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.

Ouch, that should get removed again immediately, of course.

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)

That's a separate issue.

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.

Right, we should get rid of the remainders of parameter parsing here.

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.

As explained in the mails from Samuel and Paolo, it's still used out there, so we should not break this without an easy replacement.

Gerd, can you please un-queue my patch again. I'll rework it wrt. u2f-key and the legacy parameter parsing code.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]