diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 8f88dd6854700253643cbfa073916c8185536f88..8c884f4af9cb4bd8ef47c6be42d8d13d5ed38fe9 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5210,9 +5210,9 @@ qemu-kvm -net nic,model=? /dev/null If no target is specified, certain hypervisors will automatically generate a name for the created tun device. This name can be manually specified, however the name should not - start with either 'vnet' or 'vif', which are prefixes - reserved by libvirt and certain hypervisors. Manually specified - targets using these prefixes may be ignored. + start with either 'vnet', 'vif', 'macvtap', or 'macvlan', + which are prefixes reserved by libvirt and certain hypervisors. + Manually specified targets using these prefixes may be ignored.
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7f5da4e32f795b8837af42bf43003d5bf9d4dd5f..f25a60570cbca70848518f3cb1bde8acff8eec2c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -55,6 +55,7 @@ #include "virtpm.h" #include "virstring.h" #include "virnetdev.h" +#include "virnetdevmacvlan.h" #include "virhostdev.h" #include "virmdev.h" @@ -10029,8 +10030,12 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, def->data.direct.linkdev = dev; dev = NULL; - if (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) + if (ifname && + flags & VIR_DOMAIN_DEF_PARSE_INACTIVE && + (STRPREFIX(ifname, VIR_NET_GENERATED_MACVTAP_PREFIX) || + STRPREFIX(ifname, VIR_NET_GENERATED_MACVTAP_PREFIX))) { VIR_FREE(ifname); + } break;