libvirt/SOURCES/libvirt-qemu-do-all-vhostuser-attribute-validation-in-qemu-driver.patch
2025-05-13 09:18:07 +03:00

76 lines
3.0 KiB
Diff

From a12b87879f0a1dca59c5953ac3a91a36685d17ce Mon Sep 17 00:00:00 2001
Message-ID: <a12b87879f0a1dca59c5953ac3a91a36685d17ce.1739824249.git.jdenemar@redhat.com>
From: Laine Stump <laine@redhat.com>
Date: Sun, 9 Feb 2025 19:01:32 -0500
Subject: [PATCH] qemu: do all vhostuser attribute validation in qemu driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Since vhostuser is only used/supported by the QEMU driver, and all the
rest of the vhostuser-specific validation is done in QEMU's
validation, lets move the final check (to see if they've tried to
enable auto-reconnect when this interface is on the server side of the
vhostuser socket) to the QEMU validate.
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
(cherry picked from commit 56f4cc167a6c93ec420c82f15a265ec08469279d)
https://issues.redhat.com/browse/RHEL-69455
Signed-off-by: Laine Stump <laine@redhat.com>
---
src/conf/domain_validate.c | 10 +---------
src/qemu/qemu_validate.c | 8 ++++++++
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index f56ff5b7bb..dacde1f780 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2179,15 +2179,6 @@ virDomainNetDefValidate(const virDomainNetDef *net)
}
switch (net->type) {
- case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
- if (net->data.vhostuser->data.nix.listen &&
- net->data.vhostuser->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_YES) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("'reconnect' attribute unsupported 'server' mode for <interface type='vhostuser'>"));
- return -1;
- }
- break;
-
case VIR_DOMAIN_NET_TYPE_USER:
if (net->backend.type == VIR_DOMAIN_NET_BACKEND_PASST) {
size_t p;
@@ -2211,6 +2202,7 @@ virDomainNetDefValidate(const virDomainNetDef *net)
}
break;
+ case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_VDPA:
case VIR_DOMAIN_NET_TYPE_BRIDGE:
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 841d320541..b7b2e3d0af 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1810,6 +1810,14 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net,
}
}
+ if (net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER &&
+ net->data.vhostuser->data.nix.listen &&
+ net->data.vhostuser->data.nix.reconnect.enabled == VIR_TRISTATE_BOOL_YES) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("'reconnect' attribute is not supported when source mode='server' for <interface type='vhostuser'>"));
+ return -1;
+ }
+
if (!virDomainNetIsVirtioModel(net)) {
if (net->type == VIR_DOMAIN_NET_TYPE_VDPA ||
net->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
--
2.48.1