qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy


From: Markus Armbruster
Subject: Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
Date: Mon, 16 May 2011 10:33:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Anthony Liguori <address@hidden> writes:

> On 05/13/2011 11:36 AM, Markus Armbruster wrote:
>> When Gerd qdevified USB, he kept legacy -usbdevice working (commit
>> 0958b4cc...).  What about new USB devices?  Should they get a legacy
>> syntax, too?
>>
>> The only existing new device is usb-ccid, and it got one in commit
>> 36707144.
>
> What keeps -usbdevice from being a light wrapper to -device such that
> no future code is needed for this?

What would that buy us?  Inhowfar is -usbdevice any lighter than
-device?

> I know some of the names are different but presumably we could use a
> map for existing ones and pass through names for newer ones.

Here's what an USB device needs to do for -usbdevice:

* For -usbdevice NAME (no parameters), set USBDeviceInfo member
  usbdevice_name to NAME.

* For -usbdevice NAME:PARAMS, additionally set USBDeviceInfo member
  usbdevice_init() to a function that parses PARAMS and creates the
  device.

  Legacy PARAMs use various ad hoc syntax, and that's why we have a
  callback here.

  For new devices, we could require regular syntax, and then a common
  callback would do.  The common NAME=VALUE,... syntax is the obvious
  choice, where the NAMEs are property names.

  But then -usbdevice is *exactly* like -device, except you the "usb"
  goes in a different place: "-usbdevice ccid" vs. "-device usb-ccid".
  And except that -usbdevice is crippled for some devices.  For
  instance, usb-ccid doesn't support parameters with -usbdevice, even
  though it has a qdev property.



reply via email to

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