qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Markus Armbruster <armbru@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 17:06:31 +0100	[thread overview]
Message-ID: <23db3eef-7b13-62cb-a164-12d82b763886@redhat.com> (raw)
In-Reply-To: <87y2ev2lmr.fsf@dusky.pond.sub.org>

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



      parent reply	other threads:[~2021-03-10 16:53 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
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 [this message]

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=23db3eef-7b13-62cb-a164-12d82b763886@redhat.com \
    --to=thuth@redhat.com \
    --cc=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 \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).