* [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
@ 2011-05-13 16:36 Markus Armbruster
2011-05-13 16:47 ` Anthony Liguori
0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2011-05-13 16:36 UTC (permalink / raw)
To: qemu-devel; +Cc: Alon Levy, Gerd Hoffmann
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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
2011-05-13 16:36 [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice? Markus Armbruster
@ 2011-05-13 16:47 ` Anthony Liguori
2011-05-16 8:01 ` Gerd Hoffmann
2011-05-16 8:33 ` Markus Armbruster
0 siblings, 2 replies; 5+ messages in thread
From: Anthony Liguori @ 2011-05-13 16:47 UTC (permalink / raw)
To: Markus Armbruster; +Cc: Alon Levy, qemu-devel, Gerd Hoffmann
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?
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.
Regards,
Anthony Liguori
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
2011-05-13 16:47 ` Anthony Liguori
@ 2011-05-16 8:01 ` Gerd Hoffmann
2011-05-16 8:33 ` Markus Armbruster
1 sibling, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2011-05-16 8:01 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Alon Levy, Markus Armbruster, qemu-devel
On 05/13/11 18:47, Anthony Liguori wrote:
> 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?
Any reason to do that? We already have a number of devices which can be
setup via -device only, and that is perfectly fine IMHO. Also I don't
want extend the legacy syntax when adding new properties for new
features to usb devices, which will add more cases where you have to use
-device to use new features.
>> 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?
Different command line syntax. Each device (which needs/accepts
parameters) has a init function to handle the -usbdevice command line,
which basically does:
* parse old syntax
* usb_create()
* qdev_set_prop_*() calls
* qdev_init
> 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.
Just the device name is easy, there is a field in USBDeviceInfo for that
already, and in fact "-usbdevice tablet" acts like "-device usb-tablet"
thanks to that entry ;)
cheers,
Gerd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
2011-05-13 16:47 ` Anthony Liguori
2011-05-16 8:01 ` Gerd Hoffmann
@ 2011-05-16 8:33 ` Markus Armbruster
2011-05-17 10:37 ` Kevin Wolf
1 sibling, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2011-05-16 8:33 UTC (permalink / raw)
To: Anthony Liguori; +Cc: Alon Levy, qemu-devel, Gerd Hoffmann
Anthony Liguori <anthony@codemonkey.ws> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
2011-05-16 8:33 ` Markus Armbruster
@ 2011-05-17 10:37 ` Kevin Wolf
0 siblings, 0 replies; 5+ messages in thread
From: Kevin Wolf @ 2011-05-17 10:37 UTC (permalink / raw)
To: Markus Armbruster; +Cc: Alon Levy, qemu-devel, Gerd Hoffmann
Am 16.05.2011 10:33, schrieb Markus Armbruster:
> Anthony Liguori <anthony@codemonkey.ws> 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?
One difference is that it automagically gives you an USB host
controller, whereas with -device you need to specify one explicitly.
Kevin
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-05-17 10:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-13 16:36 [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice? Markus Armbruster
2011-05-13 16:47 ` Anthony Liguori
2011-05-16 8:01 ` Gerd Hoffmann
2011-05-16 8:33 ` Markus Armbruster
2011-05-17 10:37 ` Kevin Wolf
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).