All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Alon Levy <alevy@redhat.com>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [Qemu-devel] Should new USB devices such as usb-ccid support legacy -usbdevice?
Date: Mon, 16 May 2011 10:33:28 +0200	[thread overview]
Message-ID: <m3ei3zxcx3.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <4DCD60AF.5090107@codemonkey.ws> (Anthony Liguori's message of "Fri, 13 May 2011 11:47:43 -0500")

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.

  parent reply	other threads:[~2011-05-16  8:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-05-17 10:37     ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ei3zxcx3.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=alevy@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.