From: Laine Stump Date: Mon, 20 Feb 2023 20:14:23 +0000 (-0500) Subject: qemu: add check for QEMU_CAPS_NETDEV_STREAM during validation X-Git-Tag: v9.1.0-rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dffc40db695c9b6d089f7fdc1be9fde00f917c58;p=thirdparty%2Flibvirt.git qemu: add check for QEMU_CAPS_NETDEV_STREAM during validation In commit 5af6134e I had added a new capability that is true if QEMU allows "-netdev stream", but somehow neglected to actually check it in commit a56f0168d when hooking up passt support to qemu. This isn't catastrophic, since QEMU itself will still report an error, but that error isn't as easy to understand as a libvirt-generated error. Fixes: a56f0168d576fa01cec204dc3c67d4d63ab8487f Signed-off-by: Laine Stump Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 12055d5402..c877aa73d4 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1837,6 +1837,12 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net, size_t i; if (net->type == VIR_DOMAIN_NET_TYPE_USER) { + if (net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST && + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_NETDEV_STREAM)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("the passt network backend is not supported with this QEMU binary")); + return -1; + } if (net->guestIP.nroutes) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Invalid attempt to set network interface " diff --git a/tests/qemuxml2xmloutdata/net-user-passt.x86_64-latest.xml b/tests/qemuxml2xmloutdata/net-user-passt.x86_64-latest.xml new file mode 100644 index 0000000000..d7e0ef5f90 --- /dev/null +++ b/tests/qemuxml2xmloutdata/net-user-passt.x86_64-latest.xml @@ -0,0 +1,61 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219136 + 219136 + 1 + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +