Skip to content

Replace device names containing whitespace

Markus Armbruster qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 1 replyIn review
  2. v11 patch 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3qdev: Rename USBDevice member devname to product_deschw/bt-hid.c hw/usb-bus.c hw/usb-hid.c +3 more+13 -120 replies
2/3qdev: Separate USB product description from qdev namehw/usb-bt.c hw/usb-bus.c hw/usb-hid.c +8 more+15 -10 replies
3/3qdev: Replace device names containing whitespacehw/bt-hid.c hw/cirrus_vga.c hw/grackle_pci.c +16 more+56 -630 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [FOR 0.12 PATCH v2 0/3] Replace device names containing whitespace

Device names with whitespace require quoting in the shell and in the monitor. Some of the offenders are also overly long. Some have a more convenient alias, some don't.

The place for verbose device names is DeviceInfo member desc. The name should be short & sweet.

This patch gets rid of the spaces. It normalizes names it touches to lower case with '-' separators. This seems to be the most common style. If you want me to normalize all device names, I can do that.

On naming style: we have 187 device names. 41 of them use upper case. 40 use '-' as separator, 39 use '_', 19 use ',', and 30 use space. 10 of them use two different separators simultaneously.

I checked every use of DeviceInfo members name and alias to find places that use it for purposes other than naming qdevs. They are:

* Some NIC initialization functions pass the qdev name to qemu_new_nic() parameter model. It ends up in VLANClientState member model. I believe changing that from long description to short name is an improvement. None of the devices using qemu_new_nic() that way get their names changed here.

* usb_qdev_init() copies the qdev name to USBDevice devname. Gets overwritten for usb-host devices, but not for the others. This is what Gerd pointed out. I fixed it just like Gerd recommended.

Markus Armbruster (3):
qdev: Rename USBDevice member devname to product_desc
qdev: Separate USB product description from qdev name
qdev: Replace device names containing whitespace

 hw/bt-hid.c      |    4 ++--
 hw/cirrus_vga.c  |    5 +++--
 hw/grackle_pci.c |    4 ++--
 hw/ide/cmd646.c  |    4 ++--
 hw/ide/piix.c    |    8 ++++----
 hw/unin_pci.c    |   30 +++++++++++++++---------------
 hw/usb-bt.c      |    5 +++--
 hw/usb-bus.c     |   13 +++++++------
 hw/usb-hid.c     |   14 +++++++-------
 hw/usb-hub.c     |    3 ++-
 hw/usb-msd.c     |    6 +++---
 hw/usb-net.c     |    5 +++--
 hw/usb-ohci.c    |    5 ++---
 hw/usb-serial.c  |   12 ++++++------
 hw/usb-uhci.c    |    8 ++++----
 hw/usb-wacom.c   |    5 +++--
 hw/usb.h         |    4 +++-
 hw/vmware_vga.c  |    4 ++--
 usb-bsd.c        |    9 +++++----
 usb-linux.c      |   10 +++++-----
 20 files changed, 83 insertions(+), 75 deletions(-)