From: Markus Armbruster <armbru@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org,
"Samuel Thibault" <samuel.thibault@ens-lyon.org>,
"Gerd Hoffmann" <kraxel@redhat.com>
Subject: Re: [PATCH v2] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
Date: Wed, 10 Mar 2021 14:17:48 +0100 [thread overview]
Message-ID: <87y2ev2lmr.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20210309165035.967853-1-thuth@redhat.com> (Thomas Huth's message of "Tue, 9 Mar 2021 17:50:35 +0100")
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.
next prev parent reply other threads:[~2021-03-10 13:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-09 16:50 [PATCH v2] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) Thomas Huth
2021-03-09 17:16 ` Daniel P. Berrangé
2021-03-09 17:21 ` Paolo Bonzini
2021-03-10 12:14 ` Gerd Hoffmann
2021-03-10 10:02 ` Gerd Hoffmann
2021-03-10 10:06 ` Thomas Huth
2021-03-10 13:17 ` Markus Armbruster [this message]
2021-03-10 15:02 ` Samuel Thibault
2021-03-10 15:26 ` Paolo Bonzini
2021-03-10 15:31 ` Daniel P. Berrangé
2021-03-10 15:43 ` Samuel Thibault
2021-03-10 15:44 ` Paolo Bonzini
2021-03-10 16:06 ` Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y2ev2lmr.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kraxel@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.