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(a)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 d0e2bcaccf..577dbab0af 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2185,15 +2185,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;
@@ -2217,6 +2208,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 243c499a33..351fe38830 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1825,6 +1825,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.47.1