From: Eric Blake <eblake@redhat.com>
To: Alexander Kappner <agk@godking.net>,
kraxel@redhat.com, armbru@redhat.com
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qapi: [PATCH v2] Implement query-usbhost QMP command
Date: Tue, 17 Apr 2018 13:59:50 -0500 [thread overview]
Message-ID: <1e5cbe6c-40d2-3961-b2f5-3b2759c86f87@redhat.com> (raw)
In-Reply-To: <1523698174-22832-1-git-send-email-agk@godking.net>
[-- Attachment #1: Type: text/plain, Size: 2880 bytes --]
On 04/14/2018 04:29 AM, Alexander Kappner wrote:
> Implement a QMP command similar to the HMP's "info usbhost" command.
> This allows a QMP client to query which USB devices may be available
> for redirection. Because the availability of the command needs to
> depend on the target's (not the build host's) USB configuration,
> a stub function in host-stub.c is provided for targets without USB support.
>
> v2 of this patch resolves build failure under some configurations
> without libusb.
>
> Signed-off-by: Alexander Kappner <agk@godking.net>
> ---
> hw/usb/host-libusb.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> hw/usb/host-stub.c | 9 ++++++++
> qapi/misc.json | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 135 insertions(+)
>
> +++ b/qapi/misc.json
> @@ -270,6 +270,46 @@
> { 'command': 'query-kvm', 'returns': 'KvmInfo' }
>
> ##
> +# @query-usbhost:
> +#
> +# Returns information about USB devices available on the host
> +#
> +# Returns: a [UsbDeviceInfo]. Returns an error if compiled without
> +# CONFIG_USB_LIBUSB
s/a [UsbDeviceInfo]/a list of UsbDeviceInfo
> +#
> +# Since: TODO (maintainer insert version number if mainlined)
2.13 (it's easier to guess the next version, on the likely chance that
it does not need tweaking, than it is to force the maintainer to have to
tweak the patch on acceptance)
> +##
> +{ 'command': 'query-usbhost', 'returns': ['UsbDeviceInfo'] }
> +
> +##
> # @UuidInfo:
> #
> # Guest UUID information (Universally Unique Identifier).
> @@ -876,6 +916,28 @@
> 'regions': ['PciMemoryRegion']} }
>
> ##
> +# @UsbDeviceInfo:
> +#
> +# @speed: the speed
> +#
> +# @id_vendor: idVendor field from device descriptor
Please, new QMP interfaces should favor '-' over '_' in naming; so this
should be id-vendor, and so on.
> +#
> +# @id_product: idProduct field from device descriptor
> +#
> +# @str_product: string descriptor referenced by iProduct index, if any
What's the difference between idProduct and iProduct in the text here?
> +#
> +# @str_manufacturer: string descriptor referenced by iManufacturer index, if any
Is the 'str_' (or my preferred switch to 'str-') prefix necessary; or
can this field just be 'manufacturer'?
> +#
> +# @dev_addr: address on bus that device is connected to
> +#
> +# @bus_num: bus number device is connected to
> +##
> +{ 'struct': 'UsbDeviceInfo',
> + 'data':
> + {'speed': 'int', 'id_vendor': 'int', 'id_product' : 'int', 'str_product': 'str',
> + 'b_device_class': 'int', 'str_manufacturer' : 'str', 'dev_addr' : 'int', 'bus_num' : 'int'} }
Long line; please fit things within 80 columns.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
prev parent reply other threads:[~2018-04-17 18:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-14 9:29 [Qemu-devel] qapi: [PATCH v2] Implement query-usbhost QMP command Alexander Kappner
2018-04-16 8:29 ` Gerd Hoffmann
2018-04-16 22:52 ` Alexander Kappner
2018-04-17 7:05 ` Gerd Hoffmann
2018-04-17 18:59 ` Eric Blake [this message]
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=1e5cbe6c-40d2-3961-b2f5-3b2759c86f87@redhat.com \
--to=eblake@redhat.com \
--cc=agk@godking.net \
--cc=armbru@redhat.com \
--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 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).