From: Laine Stump <[email protected]>

The slirp backend is limited in what the netmask/prefix of a
user-specified IP address can be, but passt doesn't have these
artificial limitations - any valid prefix is okay with passt, so we
shouldn't reject them

Signed-off-by: Laine Stump <[email protected]>
---
 src/qemu/qemu_validate.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index a0ddf512f1..1c6662751b 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -1926,8 +1926,9 @@ qemuValidateDomainDeviceDefNetwork(const virDomainNetDef 
*net,
             }
             hasV4Addr = true;
 
-            if (ip->prefix > 0 &&
-                (ip->prefix < 4 || ip->prefix > 27)) {
+            if (net->backend.type != VIR_DOMAIN_NET_BACKEND_PASST &&
+                (ip->prefix > 0 &&
+                 (ip->prefix < 4 || ip->prefix > 27))) {
                 virReportError(VIR_ERR_XML_ERROR, "%s",
                                _("invalid prefix, must be in range of 4-27"));
                 return -1;
-- 
2.52.0

Reply via email to