[Top][All Lists]
[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: |
Markus Armbruster |
Subject: |
[Qemu-devel] Re: [FOR 0.12 PATCH] qdev: Replace device names containing whitespace |
Date: |
Wed, 09 Dec 2009 09:09:25 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Gerd Hoffmann <address@hidden> writes:
>> 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.
I missed that needle in the "grep -w name" haystack.
> Otherwise the patch looks fine to me.
Will fix. Thanks!