qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [FOR 0.12 PATCH] qdev: Replace device names containing


From: Gerd Hoffmann
Subject: [Qemu-devel] Re: [FOR 0.12 PATCH] qdev: Replace device names containing whitespace
Date: Wed, 09 Dec 2009 08:40:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4


diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index bb39b62..dec35bc 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -591,7 +591,7 @@ static USBDevice *usb_msd_init(const char *filename)
      }

      /* create guest device */
-    dev = usb_create(NULL /* FIXME */, "QEMU USB MSD");
+    dev = usb_create(NULL /* FIXME */, "usb-storage");
      qdev_prop_set_drive(&dev->qdev, "drive", dinfo);
      if (qdev_init(&dev->qdev)<  0)
          return NULL;
@@ -600,8 +600,7 @@ static USBDevice *usb_msd_init(const char *filename)
  }

  static struct USBDeviceInfo msd_info = {
-    .qdev.name      = "QEMU USB MSD",
-    .qdev.alias     = "usb-storage",
+    .qdev.name      = "usb-storage",
      .qdev.size      = sizeof(MSDState),
      .init           = usb_msd_initfn,
      .handle_packet  = usb_generic_handle_packet,

No. USB needs some more care. DeviceInfo->name is also used as default value for USBDevice->devname. See usb_qdev_init(). Most usb backends don't change it. So this change is visible in both 'info usb' monitor command and within the guest (check /proc/bus/usb/devices).

I'd suggest to add a new field to USBDeviceInfo, stick the long name there and use that in usb_qdev_init() then.

Otherwise the patch looks fine to me.

cheers,
  Gerd




reply via email to

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