qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Clean up the -usbdevice mess
@ 2021-03-10 17:33 Thomas Huth
  2021-03-10 17:33 ` [PATCH 1/4] usb: remove support for -usbdevice parameters Thomas Huth
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Thomas Huth @ 2021-03-10 17:33 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	Markus Armbruster, Samuel Thibault

"-usbdevice" is still useful for some users. Thus let's clean up the
unwanted parts and make sure that the rest is in a better shape again.

Paolo Bonzini (2):
  usb: remove support for -usbdevice parameters
  usb: remove '-usbdevice u2f-key'

Thomas Huth (2):
  usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets
    removed)
  usb: Document the missing -usbdevice options

 docs/system/deprecated.rst       |  9 --------
 docs/system/removed-features.rst |  8 ++++++++
 hw/usb/bus.c                     | 32 +++++++----------------------
 hw/usb/dev-audio.c               |  1 -
 hw/usb/dev-serial.c              |  2 +-
 hw/usb/u2f.c                     |  1 -
 include/hw/usb.h                 |  2 +-
 qemu-options.hx                  | 35 ++++++++++++++++++++++++++------
 softmmu/vl.c                     |  2 --
 9 files changed, 46 insertions(+), 46 deletions(-)

-- 
2.27.0



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 1/4] usb: remove support for -usbdevice parameters
  2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
@ 2021-03-10 17:33 ` Thomas Huth
  2021-03-10 18:19   ` Eric Blake
  2021-03-10 17:33 ` [PATCH 2/4] usb: remove '-usbdevice u2f-key' Thomas Huth
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2021-03-10 17:33 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	Markus Armbruster, Samuel Thibault

From: Paolo Bonzini <pbonzini@redhat.com>

No device needs them anymore and in fact they're undocumented.
Remove the code.  The only change in behavior is that "-usbdevice
braille:hello" now reports an error, which is a bugfix.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/usb/bus.c        | 32 +++++++-------------------------
 hw/usb/dev-serial.c |  2 +-
 include/hw/usb.h    |  2 +-
 3 files changed, 9 insertions(+), 27 deletions(-)

diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 064f94e9c3..4b8882427d 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -312,13 +312,13 @@ typedef struct LegacyUSBFactory
 {
     const char *name;
     const char *usbdevice_name;
-    USBDevice *(*usbdevice_init)(const char *params);
+    USBDevice *(*usbdevice_init)(void);
 } LegacyUSBFactory;
 
 static GSList *legacy_usb_factory;
 
 void usb_legacy_register(const char *typename, const char *usbdevice_name,
-                         USBDevice *(*usbdevice_init)(const char *params))
+                         USBDevice *(*usbdevice_init)(void))
 {
     if (usbdevice_name) {
         LegacyUSBFactory *f = g_malloc0(sizeof(*f));
@@ -663,27 +663,17 @@ void hmp_info_usb(Monitor *mon, const QDict *qdict)
 }
 
 /* handle legacy -usbdevice cmd line option */
-USBDevice *usbdevice_create(const char *cmdline)
+USBDevice *usbdevice_create(const char *driver)
 {
     USBBus *bus = usb_bus_find(-1 /* any */);
     LegacyUSBFactory *f = NULL;
     Error *err = NULL;
     GSList *i;
-    char driver[32];
-    const char *params;
-    int len;
     USBDevice *dev;
 
-    params = strchr(cmdline,':');
-    if (params) {
-        params++;
-        len = params - cmdline;
-        if (len > sizeof(driver))
-            len = sizeof(driver);
-        pstrcpy(driver, len, cmdline);
-    } else {
-        params = "";
-        pstrcpy(driver, sizeof(driver), cmdline);
+    if (strchr(driver, ':')) {
+        error_report("usbdevice parameters are not supported anymore");
+        return NULL;
     }
 
     for (i = legacy_usb_factory; i; i = i->next) {
@@ -707,15 +697,7 @@ USBDevice *usbdevice_create(const char *cmdline)
         return NULL;
     }
 
-    if (f->usbdevice_init) {
-        dev = f->usbdevice_init(params);
-    } else {
-        if (*params) {
-            error_report("usbdevice %s accepts no params", driver);
-            return NULL;
-        }
-        dev = usb_new(f->name);
-    }
+    dev = f->usbdevice_init ? f->usbdevice_init() : usb_new(f->name);
     if (!dev) {
         error_report("Failed to create USB device '%s'", f->name);
         return NULL;
diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c
index b58c4eb908..63047d79cf 100644
--- a/hw/usb/dev-serial.c
+++ b/hw/usb/dev-serial.c
@@ -614,7 +614,7 @@ static void usb_serial_realize(USBDevice *dev, Error **errp)
     s->intr = usb_ep_get(dev, USB_TOKEN_IN, 1);
 }
 
-static USBDevice *usb_braille_init(const char *unused)
+static USBDevice *usb_braille_init(void)
 {
     USBDevice *dev;
     Chardev *cdrv;
diff --git a/include/hw/usb.h b/include/hw/usb.h
index abfbfc5284..08684bcd27 100644
--- a/include/hw/usb.h
+++ b/include/hw/usb.h
@@ -500,7 +500,7 @@ void usb_bus_new(USBBus *bus, size_t bus_size,
 void usb_bus_release(USBBus *bus);
 USBBus *usb_bus_find(int busnr);
 void usb_legacy_register(const char *typename, const char *usbdevice_name,
-                         USBDevice *(*usbdevice_init)(const char *params));
+                         USBDevice *(*usbdevice_init)(void));
 USBDevice *usb_new(const char *name);
 bool usb_realize_and_unref(USBDevice *dev, USBBus *bus, Error **errp);
 USBDevice *usb_create_simple(USBBus *bus, const char *name);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/4] usb: remove '-usbdevice u2f-key'
  2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
  2021-03-10 17:33 ` [PATCH 1/4] usb: remove support for -usbdevice parameters Thomas Huth
@ 2021-03-10 17:33 ` Thomas Huth
  2021-03-10 17:33 ` [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) Thomas Huth
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2021-03-10 17:33 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	Markus Armbruster, Samuel Thibault

From: Paolo Bonzini <pbonzini@redhat.com>

It never worked.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/usb/u2f.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/usb/u2f.c b/hw/usb/u2f.c
index bc09191f06..56001249a4 100644
--- a/hw/usb/u2f.c
+++ b/hw/usb/u2f.c
@@ -346,7 +346,6 @@ static const TypeInfo u2f_key_info = {
 static void u2f_key_register_types(void)
 {
     type_register_static(&u2f_key_info);
-    usb_legacy_register(TYPE_U2F_KEY, "u2f-key", NULL);
 }
 
 type_init(u2f_key_register_types)
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
  2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
  2021-03-10 17:33 ` [PATCH 1/4] usb: remove support for -usbdevice parameters Thomas Huth
  2021-03-10 17:33 ` [PATCH 2/4] usb: remove '-usbdevice u2f-key' Thomas Huth
@ 2021-03-10 17:33 ` Thomas Huth
  2021-03-11  8:38   ` Markus Armbruster
  2021-03-10 17:33 ` [PATCH 4/4] usb: Document the missing -usbdevice options Thomas Huth
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2021-03-10 17:33 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	Markus Armbruster, Samuel Thibault

When trying to remove the -usbdevice option, there were complaints that
"-usbdevice braille" is still a very useful shortcut for some people.
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.

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>
---
 docs/system/deprecated.rst       | 9 ---------
 docs/system/removed-features.rst | 8 ++++++++
 hw/usb/dev-audio.c               | 1 -
 softmmu/vl.c                     | 2 --
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index cfabe69846..816eb4084f 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -21,15 +21,6 @@ deprecated.
 System emulator command line arguments
 --------------------------------------
 
-``-usbdevice`` (since 2.10.0)
-'''''''''''''''''''''''''''''
-
-The ``-usbdevice DEV`` argument is now a synonym for setting
-the ``-device usb-DEV`` argument instead. The deprecated syntax
-would automatically enable USB support on the machine type.
-If using the new syntax, USB support must be explicitly
-enabled via the ``-machine usb=on`` argument.
-
 ``-drive file=json:{...{'driver':'file'}}`` (since 3.0)
 '''''''''''''''''''''''''''''''''''''''''''''''''''''''
 
diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index c8481cafbd..ea28904e5f 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -38,6 +38,14 @@ or ``-display default,show-cursor=on`` instead.
 QEMU 5.0 introduced an alternative syntax to specify the size of the translation
 block cache, ``-accel tcg,tb-size=``.
 
+``-usbdevice audio`` (removed in 6.0)
+'''''''''''''''''''''''''''''''''''''
+
+This option lacked the possibility to specify an audio backend device.
+Use ``-device usb-audio`` now instead (and specify a corresponding USB
+host controller or ``-usb`` if necessary).
+
+
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
 
diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c
index e1486f81e0..f5cb246792 100644
--- a/hw/usb/dev-audio.c
+++ b/hw/usb/dev-audio.c
@@ -1024,7 +1024,6 @@ static const TypeInfo usb_audio_info = {
 static void usb_audio_register_types(void)
 {
     type_register_static(&usb_audio_info);
-    usb_legacy_register(TYPE_USB_AUDIO, "audio", NULL);
 }
 
 type_init(usb_audio_register_types)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index ff488ea3e7..76ebe7bb7a 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3180,8 +3180,6 @@ void qemu_init(int argc, char **argv, char **envp)
                 qemu_opts_parse_noisily(olist, "usb=on", false);
                 break;
             case QEMU_OPTION_usbdevice:
-                error_report("'-usbdevice' is deprecated, please use "
-                             "'-device usb-...' instead");
                 olist = qemu_find_opts("machine");
                 qemu_opts_parse_noisily(olist, "usb=on", false);
                 add_device_config(DEV_USB, optarg);
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/4] usb: Document the missing -usbdevice options
  2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
                   ` (2 preceding siblings ...)
  2021-03-10 17:33 ` [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) Thomas Huth
@ 2021-03-10 17:33 ` Thomas Huth
  2021-03-11  8:41 ` [PATCH 0/4] Clean up the -usbdevice mess Gerd Hoffmann
  2021-03-11  9:28 ` [PATCH 5/4] usb: Remove "-usbdevice ccid" Thomas Huth
  5 siblings, 0 replies; 15+ messages in thread
From: Thomas Huth @ 2021-03-10 17:33 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	Markus Armbruster, Samuel Thibault

There are some more -usbdevice options that have never been mentioned
in the documentation. Now that we removed -usbdevice from the list
of deprecated features again, we should document them properly.

While we're at it, also sort them alphabetically.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qemu-options.hx | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 90801286c6..fdecee758a 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1705,7 +1705,7 @@ ERST
 
 DEFHEADING()
 
-DEFHEADING(USB options:)
+DEFHEADING(USB convenience options:)
 
 DEF("usb", 0, QEMU_OPTION_usb,
     "-usb            enable on-board USB host controller (if not enabled by default)\n",
@@ -1723,9 +1723,31 @@ DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
     QEMU_ARCH_ALL)
 SRST
 ``-usbdevice devname``
-    Add the USB device devname. Note that this option is deprecated,
-    please use ``-device usb-...`` instead. See the chapter about
+    Add the USB device devname, and enable an on-board USB controller
+    if possible and necessary (just like it can be done via
+    ``-machine usb=on``). Note that this option is mainly intended for
+    the user's convenience only. More fine-grained control can be
+    achieved by selecting a USB host controller (if necessary) and the
+    desired USB device via the ``-device`` option instead. For example,
+    instead of using ``-usbdevice mouse`` it is possible to use
+    ``-device qemu-xhci -device usb-mouse`` to connect the USB mouse
+    to a USB 3.0 controller instead (at least on machines that support
+    PCI and do not have an USB controller enabled by default yet).
+    For more details, see the chapter about
     :ref:`Connecting USB devices` in the System Emulation Users Guide.
+    Possible devices for devname are:
+
+    ``braille``
+        Braille device. This will use BrlAPI to display the braille
+        output on a real or fake device (i.e. it also creates a
+        corresponding ``braille`` chardev automatically beside the
+        ``usb-braille`` USB device).
+
+    ``ccid``
+        Smartcard reader device
+
+    ``keyboard``
+        Standard USB keyboard. Will override the PS/2 keyboard (if present).
 
     ``mouse``
         Virtual Mouse. This will override the PS/2 mouse emulation when
@@ -1737,9 +1759,10 @@ SRST
         position without having to grab the mouse. Also overrides the
         PS/2 mouse emulation when activated.
 
-    ``braille``
-        Braille device. This will use BrlAPI to display the braille
-        output on a real or fake device.
+    ``wacom-tablet``
+        Wacom PenPartner USB tablet.
+
+
 ERST
 
 DEFHEADING()
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/4] usb: remove support for -usbdevice parameters
  2021-03-10 17:33 ` [PATCH 1/4] usb: remove support for -usbdevice parameters Thomas Huth
@ 2021-03-10 18:19   ` Eric Blake
  0 siblings, 0 replies; 15+ messages in thread
From: Eric Blake @ 2021-03-10 18:19 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Gerd Hoffmann
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	Markus Armbruster, Samuel Thibault

On 3/10/21 11:33 AM, Thomas Huth wrote:
> From: Paolo Bonzini <pbonzini@redhat.com>
> 
> No device needs them anymore and in fact they're undocumented.
> Remove the code.  The only change in behavior is that "-usbdevice
> braille:hello" now reports an error, which is a bugfix.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  hw/usb/bus.c        | 32 +++++++-------------------------
>  hw/usb/dev-serial.c |  2 +-
>  include/hw/usb.h    |  2 +-
>  3 files changed, 9 insertions(+), 27 deletions(-)
> 

> +    if (strchr(driver, ':')) {
> +        error_report("usbdevice parameters are not supported anymore");

Although wiktionary says it is a valid word in the US, 'anymore' feels
colloquial compared to 'any more'.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
  2021-03-10 17:33 ` [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) Thomas Huth
@ 2021-03-11  8:38   ` Markus Armbruster
  2021-03-11  9:14     ` Thomas Huth
  2021-03-11 10:29     ` Paolo Bonzini
  0 siblings, 2 replies; 15+ messages in thread
From: Markus Armbruster @ 2021-03-11  8:38 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	qemu-devel, Samuel Thibault, Gerd Hoffmann

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.
> 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.
>
> 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>

I accept the complaint that the replacement of "-usbdevice braille" is
less convenient.  This is not the case for the -usbdevice tablet, mouse,
keyboard, ccid, and wacom-tablet.  It is arguably the case for disk,
serial, net, and host, yet we removed those anyway, to make the regular
and more expressive interface the only one.

Perhaps braille is special enough to justify sugar.  Paolo wrote:

    Braille is worth a special case because a subset of our user base
    (blind people) will use it 100% of the time, plus it is not
    supported by libvirt and hence virt-manager

I'm not against extending the grace period to give libvirt (and hence
virt-manager) more time to transition to the regular interface.  For
libvirt, the regular (and often more expressive) interface is almost
always preferable to sugared interfaces.

I'm not even against braille sugar if our human users of braille truly
need it, as long as it's reasonably unobtrusive.  Straightforward macro
expansion is.

However, "braille is special" is only an argument for *braille* sugar.
It doesn't extend to -usbdevice tablet, mouse etc.  I am against
undeprecating these.

If we decide we want braille sugar, we then need to decide whether it
should be -usbdevice braille or something else, like -braille.

If we decide we want something else, keep -usbdevice braille deprecated
until something else is ready, then keep it deprecated for a sensible
grace period, then remove it.  Flip-flopping deprecation in between is
not helpful.

If we can't make up our minds, keep it deprecated until we do.

Only if we decide the sugar should remain -usbdevice braille, we should
undeprecate it now.

The road to the CLI hell we're in is paved with "convenience".



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 0/4] Clean up the -usbdevice mess
  2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
                   ` (3 preceding siblings ...)
  2021-03-10 17:33 ` [PATCH 4/4] usb: Document the missing -usbdevice options Thomas Huth
@ 2021-03-11  8:41 ` Gerd Hoffmann
  2021-03-11  9:28 ` [PATCH 5/4] usb: Remove "-usbdevice ccid" Thomas Huth
  5 siblings, 0 replies; 15+ messages in thread
From: Gerd Hoffmann @ 2021-03-11  8:41 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Paolo Bonzini, Daniel P . Berrangé,
	qemu-devel, Markus Armbruster, Samuel Thibault

On Wed, Mar 10, 2021 at 06:33:19PM +0100, Thomas Huth wrote:
> "-usbdevice" is still useful for some users. Thus let's clean up the
> unwanted parts and make sure that the rest is in a better shape again.
> 
> Paolo Bonzini (2):
>   usb: remove support for -usbdevice parameters
>   usb: remove '-usbdevice u2f-key'
> 
> Thomas Huth (2):
>   usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets
>     removed)
>   usb: Document the missing -usbdevice options

Added to usb queue (and unqueued the obsoleted patch of course).

thanks,
  Gerd



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
  2021-03-11  8:38   ` Markus Armbruster
@ 2021-03-11  9:14     ` Thomas Huth
  2021-03-11 11:37       ` Gerd Hoffmann
  2021-03-11 10:29     ` Paolo Bonzini
  1 sibling, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2021-03-11  9:14 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Paolo Bonzini, Daniel P.Berrangé,
	qemu-devel, Samuel Thibault, Gerd Hoffmann

On 11/03/2021 09.38, 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.
>> 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.
>>
>> 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>
> 
> I accept the complaint that the replacement of "-usbdevice braille" is
> less convenient.  This is not the case for the -usbdevice tablet, mouse,
> keyboard, ccid, and wacom-tablet.

Well, if we keep "-usbdevice braille" (which we should unless somebody comes 
up with another easy to use replacement for blind people), then it also does 
not hurt too much to keep tablet, mouse, keyboard and wacom-tablet, since 
the code for these is rather simple and thus not a great burden to maintain. 
And these are mentioned in a lot of documents, scripts and howtos out there, 
so users are used to them.

However, searching for "-usbdevice ccid", I hardly get any results, so I 
guess we could also simply remove that one.

>  It is arguably the case for disk,
> serial, net, and host, yet we removed those anyway, to make the regular
> and more expressive interface the only one.

The problem with those devices was that they used their own parameter 
parsing code, including bugs we had to take care about, so there was a 
higher level of maintenance involved there. I think that alone justified 
their removal.

> However, "braille is special" is only an argument for *braille* sugar.
> It doesn't extend to -usbdevice tablet, mouse etc.  I am against
> undeprecating these.
> 
> If we decide we want braille sugar, we then need to decide whether it
> should be -usbdevice braille or something else, like -braille.

I've raised that question three years ago already. Nobody stepped forward to 
implement -braille, so I think we should keep -usbdevice braille for now.

> If we can't make up our minds, keep it deprecated until we do.

We didn't make up our minds for three years now. In my eyes that's a 
decision for keeping -usbdevice braille around.

  Thomas



^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 5/4] usb: Remove "-usbdevice ccid"
  2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
                   ` (4 preceding siblings ...)
  2021-03-11  8:41 ` [PATCH 0/4] Clean up the -usbdevice mess Gerd Hoffmann
@ 2021-03-11  9:28 ` Thomas Huth
  2021-03-17  6:04   ` Thomas Huth
  5 siblings, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2021-03-11  9:28 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann

"-usbdevice ccid" was not documented and -usbdevice itself was marked
as deprecated before QEMU v6.0. And searching for "-usbdevice ccid"
in the internet does not show any useful results, so likely nobody
was using the ccid device via the -usbdevice option. Remove it now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 docs/system/removed-features.rst | 6 ++++++
 hw/usb/dev-smartcard-reader.c    | 1 -
 qemu-options.hx                  | 3 ---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
index ea28904e5f..335d8a5f2f 100644
--- a/docs/system/removed-features.rst
+++ b/docs/system/removed-features.rst
@@ -45,6 +45,12 @@ This option lacked the possibility to specify an audio backend device.
 Use ``-device usb-audio`` now instead (and specify a corresponding USB
 host controller or ``-usb`` if necessary).
 
+``-usbdevice ccid`` (removed in 6.0)
+'''''''''''''''''''''''''''''''''''''
+
+This option was undocumented and not used in the field.
+Use `-device usb-ccid`` instead.
+
 
 QEMU Machine Protocol (QMP) commands
 ------------------------------------
diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
index 80109fa551..bc3d94092a 100644
--- a/hw/usb/dev-smartcard-reader.c
+++ b/hw/usb/dev-smartcard-reader.c
@@ -1492,7 +1492,6 @@ static void ccid_register_types(void)
     type_register_static(&ccid_bus_info);
     type_register_static(&ccid_card_type_info);
     type_register_static(&ccid_info);
-    usb_legacy_register(TYPE_USB_CCID_DEV, "ccid", NULL);
 }
 
 type_init(ccid_register_types)
diff --git a/qemu-options.hx b/qemu-options.hx
index fdecee758a..8f4ede1e11 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -1743,9 +1743,6 @@ SRST
         corresponding ``braille`` chardev automatically beside the
         ``usb-braille`` USB device).
 
-    ``ccid``
-        Smartcard reader device
-
     ``keyboard``
         Standard USB keyboard. Will override the PS/2 keyboard (if present).
 
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
  2021-03-11  8:38   ` Markus Armbruster
  2021-03-11  9:14     ` Thomas Huth
@ 2021-03-11 10:29     ` Paolo Bonzini
  1 sibling, 0 replies; 15+ messages in thread
From: Paolo Bonzini @ 2021-03-11 10:29 UTC (permalink / raw)
  To: Markus Armbruster, Thomas Huth
  Cc: Samuel Thibault, Daniel P.Berrangé, qemu-devel, Gerd Hoffmann

On 11/03/21 09:38, Markus Armbruster wrote:
> 
> If we decide we want something else, keep -usbdevice braille deprecated
> until something else is ready, then keep it deprecated for a sensible
> grace period, then remove it.  Flip-flopping deprecation in between is
> not helpful.
> 
> If we can't make up our minds, keep it deprecated until we do.
> 
> Only if we decide the sugar should remain -usbdevice braille, we should
> undeprecate it now.
> 
> The road to the CLI hell we're in is paved with "convenience".

A lot of the work I did in 6.0 on vl.c and friends was exactly to figure 
out:

- which of our CLI interfaces are a maintainability issue and really 
need deprecation

- which of our CLI interfaces can be modified to improve maintainability 
and simplify the addition of new interfaces

- how machine creation *really* works, so that it's easy to add things 
at the right spot.

Of course _everything_ is a maintenance cost, but you can at least make 
sure that the cost is not visible to most developers.  This series, as 
well as the previous removal of parameterized -usbdevice is just doing 
that: keep the decent parts that do not hamper maintainability, 
deprecate/remove the rest.

Paolo



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
  2021-03-11  9:14     ` Thomas Huth
@ 2021-03-11 11:37       ` Gerd Hoffmann
  2021-03-11 11:45         ` Samuel Thibault
  0 siblings, 1 reply; 15+ messages in thread
From: Gerd Hoffmann @ 2021-03-11 11:37 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Paolo Bonzini, Daniel P.Berrangé,
	Markus Armbruster, Samuel Thibault, qemu-devel

  Hi,

> >  It is arguably the case for disk,
> > serial, net, and host, yet we removed those anyway, to make the regular
> > and more expressive interface the only one.
> 
> The problem with those devices was that they used their own parameter
> parsing code,

Yes, that was IMHO the most important issue.  Two ways to configure
devices, the usual properties and the hand-crafted and often buggy
device-specific parsers.

Now we are down to simple aliasing without parameter support, except
for braille which has the special chardev handling.  Given we keep
braille support anyway there is little reason to drop the aliasing
support for the other devices which don't require parameters.  It's
literally a single line of code per device, hardly a big maintainance
burden.  The benefit is we don't invalidate tons of webpages which
document "-usbdevice tablet" and the like.

> We didn't make up our minds for three years now. In my eyes that's a
> decision for keeping -usbdevice braille around.

Another option could be to integrate the braille bits into the
usb-braille device, then kill the separate chardev.  Which would
also drop support for serial braille devices.  Not sure how much
of a problem that would be these days.  But that likewise needs
someone to step up doing the work ...

take care,
  Gerd



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed)
  2021-03-11 11:37       ` Gerd Hoffmann
@ 2021-03-11 11:45         ` Samuel Thibault
  0 siblings, 0 replies; 15+ messages in thread
From: Samuel Thibault @ 2021-03-11 11:45 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Paolo Bonzini, Thomas Huth, Daniel P.Berrangé,
	Markus Armbruster, qemu-devel

Gerd Hoffmann, le jeu. 11 mars 2021 12:37:38 +0100, a ecrit:
> Which would also drop support for serial braille devices.  Not sure
> how much of a problem that would be these days.

It is an important concern: we also need to be able to test braille
devices connected through serial.

Samuel


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/4] usb: Remove "-usbdevice ccid"
  2021-03-11  9:28 ` [PATCH 5/4] usb: Remove "-usbdevice ccid" Thomas Huth
@ 2021-03-17  6:04   ` Thomas Huth
  2021-03-17  6:40     ` Gerd Hoffmann
  0 siblings, 1 reply; 15+ messages in thread
From: Thomas Huth @ 2021-03-17  6:04 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann; +Cc: Paolo Bonzini, Marc-André Lureau

On 11/03/2021 10.28, Thomas Huth wrote:
> "-usbdevice ccid" was not documented and -usbdevice itself was marked
> as deprecated before QEMU v6.0. And searching for "-usbdevice ccid"
> in the internet does not show any useful results, so likely nobody
> was using the ccid device via the -usbdevice option. Remove it now.

Any comments on this one? Shall we keep it? Or shall we remove it?

  Thomas


> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   docs/system/removed-features.rst | 6 ++++++
>   hw/usb/dev-smartcard-reader.c    | 1 -
>   qemu-options.hx                  | 3 ---
>   3 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/docs/system/removed-features.rst b/docs/system/removed-features.rst
> index ea28904e5f..335d8a5f2f 100644
> --- a/docs/system/removed-features.rst
> +++ b/docs/system/removed-features.rst
> @@ -45,6 +45,12 @@ This option lacked the possibility to specify an audio backend device.
>   Use ``-device usb-audio`` now instead (and specify a corresponding USB
>   host controller or ``-usb`` if necessary).
>   
> +``-usbdevice ccid`` (removed in 6.0)
> +'''''''''''''''''''''''''''''''''''''
> +
> +This option was undocumented and not used in the field.
> +Use `-device usb-ccid`` instead.
> +
>   
>   QEMU Machine Protocol (QMP) commands
>   ------------------------------------
> diff --git a/hw/usb/dev-smartcard-reader.c b/hw/usb/dev-smartcard-reader.c
> index 80109fa551..bc3d94092a 100644
> --- a/hw/usb/dev-smartcard-reader.c
> +++ b/hw/usb/dev-smartcard-reader.c
> @@ -1492,7 +1492,6 @@ static void ccid_register_types(void)
>       type_register_static(&ccid_bus_info);
>       type_register_static(&ccid_card_type_info);
>       type_register_static(&ccid_info);
> -    usb_legacy_register(TYPE_USB_CCID_DEV, "ccid", NULL);
>   }
>   
>   type_init(ccid_register_types)
> diff --git a/qemu-options.hx b/qemu-options.hx
> index fdecee758a..8f4ede1e11 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -1743,9 +1743,6 @@ SRST
>           corresponding ``braille`` chardev automatically beside the
>           ``usb-braille`` USB device).
>   
> -    ``ccid``
> -        Smartcard reader device
> -
>       ``keyboard``
>           Standard USB keyboard. Will override the PS/2 keyboard (if present).
>   
> 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 5/4] usb: Remove "-usbdevice ccid"
  2021-03-17  6:04   ` Thomas Huth
@ 2021-03-17  6:40     ` Gerd Hoffmann
  0 siblings, 0 replies; 15+ messages in thread
From: Gerd Hoffmann @ 2021-03-17  6:40 UTC (permalink / raw)
  To: Thomas Huth; +Cc: Paolo Bonzini, qemu-devel, Marc-André Lureau

On Wed, Mar 17, 2021 at 07:04:12AM +0100, Thomas Huth wrote:
> On 11/03/2021 10.28, Thomas Huth wrote:
> > "-usbdevice ccid" was not documented and -usbdevice itself was marked
> > as deprecated before QEMU v6.0. And searching for "-usbdevice ccid"
> > in the internet does not show any useful results, so likely nobody
> > was using the ccid device via the -usbdevice option. Remove it now.
> 
> Any comments on this one? Shall we keep it? Or shall we remove it?

Queued.  ccid is not useful standalone[1], you need hook up something to
the ccid bus it provides, which is probably the reason why -usbdevice
ccid is not used in the wild.

take care,
  Gerd

[1] Well, it'll work fine, but the guest will only see a smartcard
    reader device without smardcard plugged in ...



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-17  6:48 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 17:33 [PATCH 0/4] Clean up the -usbdevice mess Thomas Huth
2021-03-10 17:33 ` [PATCH 1/4] usb: remove support for -usbdevice parameters Thomas Huth
2021-03-10 18:19   ` Eric Blake
2021-03-10 17:33 ` [PATCH 2/4] usb: remove '-usbdevice u2f-key' Thomas Huth
2021-03-10 17:33 ` [PATCH 3/4] usb: Un-deprecate -usbdevice (except for -usbdevice audio which gets removed) Thomas Huth
2021-03-11  8:38   ` Markus Armbruster
2021-03-11  9:14     ` Thomas Huth
2021-03-11 11:37       ` Gerd Hoffmann
2021-03-11 11:45         ` Samuel Thibault
2021-03-11 10:29     ` Paolo Bonzini
2021-03-10 17:33 ` [PATCH 4/4] usb: Document the missing -usbdevice options Thomas Huth
2021-03-11  8:41 ` [PATCH 0/4] Clean up the -usbdevice mess Gerd Hoffmann
2021-03-11  9:28 ` [PATCH 5/4] usb: Remove "-usbdevice ccid" Thomas Huth
2021-03-17  6:04   ` Thomas Huth
2021-03-17  6:40     ` Gerd Hoffmann

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).