From: Laine Stump Date: Wed, 11 Feb 2026 23:31:42 +0000 (-0500) Subject: qemu: only limit IPv4 prefix for slirp X-Git-Tag: v12.2.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1468f995e7c0d10a70529862d169734fe7bb34e2;p=thirdparty%2Flibvirt.git qemu: only limit IPv4 prefix for slirp 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 Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index dc66b3bc3b..5c664d549b 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1946,8 +1946,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;