From: Stefan Hajnoczi <stefanha@redhat.com>
To: paul@xen.org
Cc: "Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
pkrempa@redhat.com, "Daniel P. Berrangé" <berrange@redhat.com>,
"Anthony PERARD" <anthony@xenproject.org>
Subject: Re: [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add
Date: Tue, 27 Aug 2024 15:20:23 -0400 [thread overview]
Message-ID: <20240827192023.GA937897@fedora.redhat.com> (raw)
In-Reply-To: <3a9f0e9a-3873-4cd0-8773-c2ed6230da81@xen.org>
[-- Attachment #1: Type: text/plain, Size: 1695 bytes --]
On Tue, Aug 13, 2024 at 09:18:46AM +0100, Paul Durrant wrote:
> On 12/08/2024 19:15, Stefan Hajnoczi wrote:
> > On Fri, Aug 02, 2024 at 10:10:43AM +0200, Markus Armbruster wrote:
> > > Can we additionally cut out the QemuOpts middleman in
> > > usbback_portid_add()?
> > >
> > > qdict = qdict_new();
> > > qdict_put_str(qdict, "driver", "usb-host");
> > > tmp = g_strdup_printf("%s.0", usbif->xendev.qdev.id);
> > > qdict_put_str(qdict, "bus", tmp);
> > > g_free(tmp);
> > > tmp = g_strdup_printf("%s-%u", usbif->xendev.qdev.id, port);
> > > qdict_put_str(qdict, "id", tmp);
> > > g_free(tmp);
> > > qdict_put_int(qdict, "port", port);
> > > qdict_put_int(qdict, "hostbus", atoi(busid));
> > > qdict_put_str(qdict, "hostport", portname);
> > > opts = qemu_opts_from_qdict(qemu_find_opts("device"), qdict,
> > > &error_abort);
> > > usbif->ports[port - 1].dev = USB_DEVICE(qdev_device_add(opts, &local_err));
> > >
> > > Trying this is up to you!
> >
> > Paul or Anthony: Do you know how to run usbback_portid_add() for
> > testing? I would like to make sure that suggested the code change works
> > and don't have experience running the Xen code in QEMU.
>
> Sorry, PV USB is not something I'm familiar with.
> https://wiki.xenproject.org/wiki/Xen_USB_Passthrough suggests that `xl
> usbdev-attach` might be the way to test... but you'd need a system with Xen
> installed and suitably configured guest, so not trivial to set up.
Thanks for the pointer! I will leave the usbback_portid_add()
refactoring because I don't have a setup for testing it.
Stefan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2024-08-27 19:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-01 14:05 [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add Stefan Hajnoczi
2024-08-01 14:05 ` [PATCH v2 1/2] " Stefan Hajnoczi
2024-08-02 8:01 ` Markus Armbruster
2024-08-12 18:07 ` Stefan Hajnoczi
2024-08-29 14:09 ` Markus Armbruster
2024-08-01 14:05 ` [PATCH v2 2/2] vl: use qmp_device_add() in qemu_create_cli_devices() Stefan Hajnoczi
2024-08-02 8:07 ` Markus Armbruster
2024-08-02 8:10 ` [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add Markus Armbruster
2024-08-12 18:15 ` Stefan Hajnoczi
2024-08-13 8:18 ` Paul Durrant
2024-08-27 19:20 ` Stefan Hajnoczi [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=20240827192023.GA937897@fedora.redhat.com \
--to=stefanha@redhat.com \
--cc=anthony@xenproject.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=pkrempa@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).