[PATCH] qrap: Support JSON syntax for -device
Starting with version 8.1.0, libvirt uses JSON syntax when
generating the arguments to -device, so they will now look like
{"driver":"virtio-scsi-pci","bus":"pci.3","addr":"0x0"}
instead of
virtio-scsi-pci,bus=pci.3,addr=0x0
qrap needs to parse these arguments and extract the bus number
in order to figure out what address to use for the virtio-net
device it adds, and the libvirt change described above has
broken this parsing logic.
Tweak the code so that both styles are accepted and handled
correctly.
Note that, when JSON is in use, qrap needs to generate its own
command line options in that format as well or things will not
work as expected.
Signed-off-by: Andrea Bolognani
Hi Andrea,
On Thu, 20 Oct 2022 11:04:19 +0200
Andrea Bolognani
Starting with version 8.1.0, libvirt uses JSON syntax when generating the arguments to -device, so they will now look like
{"driver":"virtio-scsi-pci","bus":"pci.3","addr":"0x0"}
instead of
virtio-scsi-pci,bus=pci.3,addr=0x0
qrap needs to parse these arguments and extract the bus number in order to figure out what address to use for the virtio-net device it adds, and the libvirt change described above has broken this parsing logic.
Tweak the code so that both styles are accepted and handled correctly.
Note that, when JSON is in use, qrap needs to generate its own command line options in that format as well or things will not work as expected.
Signed-off-by: Andrea Bolognani
Thanks for the patch, and welcome to the git log! For context, qrap will finally become useless once this patchset by Laurent: https://patchew.org/QEMU/20221021090922.170074-1-lvivier@redhat.com/ lands in qemu -- that should happen soon. However, we'll need to keep it around for a little longer, until an updated version of qemu reaches distributions, and, after that, still give a bit of time to users, so this is absolutely useful and appreciated. I just applied it. -- Stefano
On Sat, Oct 22, 2022 at 10:19:43AM +0200, Stefano Brivio wrote:
For context, qrap will finally become useless once this patchset by Laurent: https://patchew.org/QEMU/20221021090922.170074-1-lvivier@redhat.com/
lands in qemu -- that should happen soon.
However, we'll need to keep it around for a little longer, until an updated version of qemu reaches distributions, and, after that, still give a bit of time to users
In addition to QEMU, we also need libvirt to support passt natively. I believe there's ongoing work for that as well, but until that lands (and makes its way to distros) projects like KubeVirt are going to be relying on qrap.
I just applied it.
Thanks a lot! -- Andrea Bolognani / Red Hat / Virtualization
[Cc: Laine]
On Mon, 24 Oct 2022 03:08:47 -0700
Andrea Bolognani
On Sat, Oct 22, 2022 at 10:19:43AM +0200, Stefano Brivio wrote:
For context, qrap will finally become useless once this patchset by Laurent: https://patchew.org/QEMU/20221021090922.170074-1-lvivier@redhat.com/
lands in qemu -- that should happen soon.
However, we'll need to keep it around for a little longer, until an updated version of qemu reaches distributions, and, after that, still give a bit of time to users
In addition to QEMU, we also need libvirt to support passt natively.
I believe there's ongoing work for that as well,
Yes, I'm currently working on this topic with Laine (the patch in contrib/libvirt is using the qemu interface I implemented in contrib/qemu, which is not what we'll have in qemu eventually).
but until that lands (and makes its way to distros) projects like KubeVirt are going to be relying on qrap.
Right, it probably makes no sense to force KubeVirt to adopt this in two steps (passing qemu specific options first, and then switch to the new configuration model in libvirt), so we'll need to wait for that as well. -- Stefano
participants (2)
-
Andrea Bolognani
-
Stefano Brivio