On Sat, Apr 14, 2018 at 02:29:34AM -0700, Alexander Kappner wrote: > Implement a QMP command similar to the HMP's "info usbhost" command.
The hmp version of the command should be switched over to call the qmp_query_usbhost() and pretty-print the qapi struct then, to make sure hmp and qmp versions of the command deliver consistent results. > This allows a QMP client to query which USB devices may be available > for redirection. I'm wondering what the use case is? At least libvirt sandboxes qemu, for security reasons, and you wouldn't get any useful results because qemu hasn't the permissions needed to scan the usb bus. > ## > +# @query-usbhost: > +# > +# Returns information about USB devices available on the host > +# > +# Returns: a [UsbDeviceInfo]. Returns an error if compiled without > +# CONFIG_USB_LIBUSB > +# > +# Since: TODO (maintainer insert version number if mainlined) Will not make it into 2.12, so 2.13. > +# @UsbDeviceInfo: > +# > +# @speed: the speed Use an enum for this? > +# @id_vendor: idVendor field from device descriptor > +# > +# @id_product: idProduct field from device descriptor > +# > +# @str_product: string descriptor referenced by iProduct index, if any > +# > +# @str_manufacturer: string descriptor referenced by iManufacturer index, if > any > +# > +# @dev_addr: address on bus that device is connected to > +# > +# @bus_num: bus number device is connected to No port? cheers, Gerd