qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add


From: Paul Durrant
Subject: Re: [PATCH v2 0/2] qdev-monitor: avoid QemuOpts in QMP device_add
Date: Tue, 13 Aug 2024 09:18:46 +0100
User-agent: Mozilla Thunderbird

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]