qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, Yanan Wang <wangyanan55@huawei.com>,
	Eduardo Habkost <eduardo@habkost.net>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	"Dr . David Alan Gilbert" <dave@treblig.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Laurent Vivier <lvivier@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Don Porter <porter@cs.unc.edu>, Eric Blake <eblake@redhat.com>,
	Thomas Huth <thuth@redhat.com>
Subject: Re: [PATCH] hw/usb: Introduce x-query-usbhost QMP command
Date: Tue, 11 Jun 2024 11:59:40 +0200	[thread overview]
Message-ID: <cc648a89-c1ba-4cdf-ac7e-b6b4e3c9e263@linaro.org> (raw)
In-Reply-To: <Zma6S1bHmE4oGKhX@redhat.com>

On 10/6/24 10:33, Daniel P. Berrangé wrote:
> On Mon, Jun 10, 2024 at 08:38:47AM +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.
> 
> 'info usb' host is one of the problem scenarios i mentioned in
> 
> https://lore.kernel.org/qemu-devel/20211028155457.967291-1-berrange@redhat.com/
> 
> Its HMP impl is within a dynamically loadable module. So if you
> run it initially you'll get
> 
> (qemu) info usbhost
> Command "info usbhost" is not available.
> 
> 
> but if you have a usb host on the cli:
> 
> (qemu) info usbhost
>    Bus 3, Addr 6, Port 8, Speed 480 Mb/s
>      Class ef: USB device 04f2:b74f
>    Bus 3, Addr 11, Port 7.3, Speed 1.5 Mb/s
>    ...snip...
> 
> 
> Anyway, the end result is that this patch fails to link when modules
> are enabled:
> 
> cc -m64 @qemu-system-x86_64.rsp
> /usr/bin/ld: libqemuutil.a.p/meson-generated_.._qapi_qapi-commands-machine.c.o: in function `qmp_marshal_x_query_usbhost':
> /var/home/berrange/src/virt/qemu/build/qapi/qapi-commands-machine.c:1514: undefined reference to `qmp_x_query_usbhost'

Indeed I missed that.

> IMHO the solution to this is to refactor the cdoe to split
> hw/usb/host-libusb.c into two parts.
> 
> One part provides the monitor API impls, and some callbacks
> for feeding data to them. The other part provides the actual
> impl, and registers the callbacks needed by the monitor cmd.

Yeah something like that will do.



      reply	other threads:[~2024-06-11 10:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10  6:38 [PATCH] hw/usb: Introduce x-query-usbhost QMP command Philippe Mathieu-Daudé
2024-06-10  8:33 ` Daniel P. Berrangé
2024-06-11  9:59   ` Philippe Mathieu-Daudé [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=cc648a89-c1ba-4cdf-ac7e-b6b4e3c9e263@linaro.org \
    --to=philmd@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dave@treblig.org \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=lvivier@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=porter@cs.unc.edu \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=wangyanan55@huawei.com \
    /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).