On Tue, Jun 11, 2024 at 12:23:04PM +0200, Philippe Mathieu-Daudé wrote: > This is a counterpart to the HMP "info usbhost" command. It is being > added with an "x-" prefix because this QMP command is intended as an > adhoc debugging tool and will thus not be modelled in QAPI as fully > structured data, nor will it have long term guaranteed stability. > The existing HMP command is rewritten to call the QMP command. > > Since host-libusb.c can be built as part of the 'hw-usb' module, > we introduce the libusb_register_hmp_info_hrt() helper to allow late > registration when the module is loaded. > > Suggested-by: Daniel P. Berrangé <berra...@redhat.com> > Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> > --- > qapi/machine.json | 18 ++++++++++++++++ > hw/usb/host-libusb.h | 16 ++++++++++++++ > include/hw/usb.h | 3 --- > hw/usb/bus-stub.c | 7 +++++- > hw/usb/host-libusb-common.c | 31 ++++++++++++++++++++++++++ > hw/usb/host-libusb.c | 43 +++++++++++++++++++++++++------------ > tests/qtest/qmp-cmd-test.c | 3 +++ > hmp-commands-info.hx | 2 ++ > hw/usb/meson.build | 1 + > 9 files changed, 106 insertions(+), 18 deletions(-) > create mode 100644 hw/usb/host-libusb.h > create mode 100644 hw/usb/host-libusb-common.c
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|