[libvirt] [PATCH v2 0/3] conf: don't ignore <target dev='blah'/> for macvtap interfaces

The parser had been clearing out *all* suggested device names for type='direct' (aka macvtap) interfaces. All of the code implementing macvtap allows for a user-specified device name, so we should allow it. In the case that an interface name starts with "macvtap" or "macvlan" though, we do still clear it out, just as we do with "vnet" (which is the prefix used for automatically generated tap device names), since those are the prefixes for the names we autogenerate for macvtap and macvlan devices. Resolves: https://bugzilla.redhat.com/1335798 Changes since V1: * make a single #define for each of MACVLAN_PREFIX and MACVTAP_PREFIX in virnetdevmacvlan.h rather than duplicating #defines from virnetdevmacvlan.c into domain_conf.h (as suggested by Martin * move/rename the auto-generated prefix for regular tap devices to be consistent with the macvtap/macvlan prefixes. Laine Stump (3): util: make macvtap/macvlan generated name #defines available to other files conf: don't ignore <target dev='blah'/> for macvtap interfaces util: rename/move VIR_NET_GENERATED_PREFIX to be consistent docs/formatdomain.html.in | 6 ++-- src/bhyve/bhyve_command.c | 4 +-- src/conf/domain_conf.c | 11 ++++-- src/conf/domain_conf.h | 4 --- src/interface/interface_backend_udev.c | 2 +- src/qemu/qemu_interface.c | 8 ++--- src/uml/uml_conf.c | 4 +-- src/util/virnetdev.h | 5 +++ src/util/virnetdevmacvlan.c | 65 ++++++++++++++-------------------- src/util/virnetdevmacvlan.h | 6 ++++ 10 files changed, 57 insertions(+), 58 deletions(-) -- 2.9.3

MACVTAP_NAME_PREFIX and MACVLAN_NAME_PREFIX could be useful to other files if they were defined in virnetdevmacvlan.h instead of virnetdevmacvlan.c, so do that (while slightly renaming them and also adding yet another #define that chooses between macvlan/macvtap based on flags). This is a prerequisite to fix: https://bugzilla.redhat.com/1335798 --- src/util/virnetdevmacvlan.c | 65 ++++++++++++++++++--------------------------- src/util/virnetdevmacvlan.h | 6 +++++ 2 files changed, 32 insertions(+), 39 deletions(-) diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 7222b0f..97c8770 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -68,11 +68,11 @@ VIR_ENUM_IMPL(virNetDevMacVLanMode, VIR_NETDEV_MACVLAN_MODE_LAST, VIR_LOG_INIT("util.netdevmacvlan"); -# define MACVTAP_NAME_PREFIX "macvtap" -# define MACVTAP_NAME_PATTERN "macvtap%d" - -# define MACVLAN_NAME_PREFIX "macvlan" -# define MACVLAN_NAME_PATTERN "macvlan%d" +# define VIR_NET_GENERATED_MACVTAP_PATTERN VIR_NET_GENERATED_MACVTAP_PREFIX "%d" +# define VIR_NET_GENERATED_MACVLAN_PATTERN VIR_NET_GENERATED_MACVLAN_PREFIX "%d" +# define VIR_NET_GENERATED_PREFIX \ + ((flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? \ + VIR_NET_GENERATED_MACVTAP_PREFIX : VIR_NET_GENERATED_MACVLAN_PREFIX) # define MACVLAN_MAX_ID 8191 @@ -124,9 +124,7 @@ virNetDevMacVLanReserveID(int id, unsigned int flags, if (id > MACVLAN_MAX_ID) { virReportError(VIR_ERR_INTERNAL_ERROR, _("can't use name %s%d - out of range 0-%d"), - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, - id, MACVLAN_MAX_ID); + VIR_NET_GENERATED_PREFIX, id, MACVLAN_MAX_ID); return -1; } @@ -134,21 +132,18 @@ virNetDevMacVLanReserveID(int id, unsigned int flags, (id = virBitmapNextClearBit(bitmap, id)) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("no unused %s names available"), - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX); + VIR_NET_GENERATED_PREFIX); return -1; } if (virBitmapIsBitSet(bitmap, id)) { if (quietFail) { VIR_INFO("couldn't reserve name %s%d - already in use", - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, id); + VIR_NET_GENERATED_PREFIX, id); } else { virReportError(VIR_ERR_INTERNAL_ERROR, _("couldn't reserve name %s%d - already in use"), - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, id); + VIR_NET_GENERATED_PREFIX, id); } return -1; } @@ -156,14 +151,11 @@ virNetDevMacVLanReserveID(int id, unsigned int flags, if (virBitmapSetBit(bitmap, id) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("couldn't mark %s%d as used"), - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, id); + VIR_NET_GENERATED_PREFIX, id); return -1; } - VIR_INFO("reserving device %s%d", - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, id); + VIR_INFO("reserving device %s%d", VIR_NET_GENERATED_PREFIX, id); return id; } @@ -188,9 +180,7 @@ virNetDevMacVLanReleaseID(int id, unsigned int flags) if (id > MACVLAN_MAX_ID) { virReportError(VIR_ERR_INTERNAL_ERROR, _("can't free name %s%d - out of range 0-%d"), - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, - id, MACVLAN_MAX_ID); + VIR_NET_GENERATED_PREFIX, id, MACVLAN_MAX_ID); return -1; } @@ -199,14 +189,12 @@ virNetDevMacVLanReleaseID(int id, unsigned int flags) VIR_INFO("releasing %sdevice %s%d", virBitmapIsBitSet(bitmap, id) ? "" : "unreserved", - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, id); + VIR_NET_GENERATED_PREFIX, id); if (virBitmapClearBit(bitmap, id) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("couldn't mark %s%d as unused"), - (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX, id); + VIR_NET_GENERATED_PREFIX, id); return -1; } return 0; @@ -236,11 +224,11 @@ virNetDevMacVLanReserveName(const char *name, bool quietFail) if (virNetDevMacVLanInitialize() < 0) return -1; - if (STRPREFIX(name, MACVTAP_NAME_PREFIX)) { - idstr = name + strlen(MACVTAP_NAME_PREFIX); + if (STRPREFIX(name, VIR_NET_GENERATED_MACVTAP_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVTAP_PREFIX); flags |= VIR_NETDEV_MACVLAN_CREATE_WITH_TAP; - } else if (STRPREFIX(name, MACVLAN_NAME_PREFIX)) { - idstr = name + strlen(MACVLAN_NAME_PREFIX); + } else if (STRPREFIX(name, VIR_NET_GENERATED_MACVLAN_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVLAN_PREFIX); } else { return -2; } @@ -276,11 +264,11 @@ virNetDevMacVLanReleaseName(const char *name) if (virNetDevMacVLanInitialize() < 0) return -1; - if (STRPREFIX(name, MACVTAP_NAME_PREFIX)) { - idstr = name + strlen(MACVTAP_NAME_PREFIX); + if (STRPREFIX(name, VIR_NET_GENERATED_MACVTAP_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVTAP_PREFIX); flags |= VIR_NETDEV_MACVLAN_CREATE_WITH_TAP; - } else if (STRPREFIX(name, MACVLAN_NAME_PREFIX)) { - idstr = name + strlen(MACVLAN_NAME_PREFIX); + } else if (STRPREFIX(name, VIR_NET_GENERATED_MACVLAN_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVLAN_PREFIX); } else { return 0; } @@ -985,10 +973,9 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested, size_t tapfdSize, unsigned int flags) { - const char *type = (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PREFIX : MACVLAN_NAME_PREFIX; + const char *type = VIR_NET_GENERATED_PREFIX; const char *pattern = (flags & VIR_NETDEV_MACVLAN_CREATE_WITH_TAP) ? - MACVTAP_NAME_PATTERN : MACVLAN_NAME_PATTERN; + VIR_NET_GENERATED_MACVTAP_PATTERN : VIR_NET_GENERATED_MACVLAN_PATTERN; int reservedID = -1; char ifname[IFNAMSIZ]; int retries, do_retry = 0; @@ -1031,8 +1018,8 @@ virNetDevMacVLanCreateWithVPortProfile(const char *ifnameRequested, if (ifnameRequested) { int rc; bool isAutoName - = (STRPREFIX(ifnameRequested, MACVTAP_NAME_PREFIX) || - STRPREFIX(ifnameRequested, MACVLAN_NAME_PREFIX)); + = (STRPREFIX(ifnameRequested, VIR_NET_GENERATED_MACVTAP_PREFIX) || + STRPREFIX(ifnameRequested, VIR_NET_GENERATED_MACVLAN_PREFIX)); VIR_INFO("Requested macvtap device name: %s", ifnameRequested); virMutexLock(&virNetDevMacVLanCreateMutex); diff --git a/src/util/virnetdevmacvlan.h b/src/util/virnetdevmacvlan.h index c40f23e..a7c4b6d 100644 --- a/src/util/virnetdevmacvlan.h +++ b/src/util/virnetdevmacvlan.h @@ -51,6 +51,12 @@ typedef enum { VIR_NETDEV_MACVLAN_VNET_HDR = 1 << 2, } virNetDevMacVLanCreateFlags; +/* libvirt will start macvtap/macvlan interface names with one of + * these prefixes when it auto-generates the name + */ +# define VIR_NET_GENERATED_MACVTAP_PREFIX "macvtap" +# define VIR_NET_GENERATED_MACVLAN_PREFIX "macvlan" + int virNetDevMacVLanReserveName(const char *name, bool quietfail); int virNetDevMacVLanReleaseName(const char *name); -- 2.9.3

On Tue, Apr 25, 2017 at 02:50:35PM -0400, Laine Stump wrote:
MACVTAP_NAME_PREFIX and MACVLAN_NAME_PREFIX could be useful to other files if they were defined in virnetdevmacvlan.h instead of virnetdevmacvlan.c, so do that (while slightly renaming them and also adding yet another #define that chooses between macvlan/macvtap based on flags).
This is a prerequisite to fix: https://bugzilla.redhat.com/1335798 --- src/util/virnetdevmacvlan.c | 65 ++++++++++++++++++--------------------------- src/util/virnetdevmacvlan.h | 6 +++++ 2 files changed, 32 insertions(+), 39 deletions(-)
diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index 7222b0f..97c8770 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -236,11 +224,11 @@ virNetDevMacVLanReserveName(const char *name, bool quietFail) if (virNetDevMacVLanInitialize() < 0) return -1;
- if (STRPREFIX(name, MACVTAP_NAME_PREFIX)) { - idstr = name + strlen(MACVTAP_NAME_PREFIX); + if (STRPREFIX(name, VIR_NET_GENERATED_MACVTAP_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVTAP_PREFIX); flags |= VIR_NETDEV_MACVLAN_CREATE_WITH_TAP; - } else if (STRPREFIX(name, MACVLAN_NAME_PREFIX)) { - idstr = name + strlen(MACVLAN_NAME_PREFIX); + } else if (STRPREFIX(name, VIR_NET_GENERATED_MACVLAN_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVLAN_PREFIX); } else { return -2; } @@ -276,11 +264,11 @@ virNetDevMacVLanReleaseName(const char *name) if (virNetDevMacVLanInitialize() < 0) return -1;
- if (STRPREFIX(name, MACVTAP_NAME_PREFIX)) { - idstr = name + strlen(MACVTAP_NAME_PREFIX); + if (STRPREFIX(name, VIR_NET_GENERATED_MACVTAP_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVTAP_PREFIX); flags |= VIR_NETDEV_MACVLAN_CREATE_WITH_TAP; - } else if (STRPREFIX(name, MACVLAN_NAME_PREFIX)) { - idstr = name + strlen(MACVLAN_NAME_PREFIX); + } else if (STRPREFIX(name, VIR_NET_GENERATED_MACVLAN_PREFIX)) { + idstr = name + strlen(VIR_NET_GENERATED_MACVLAN_PREFIX);
Just a note to someone interested as this is pre-existing, but I think STRSKIP could make these nicer.

The parser had been clearing out *all* suggested device names for type='direct' (aka macvtap) interfaces. All of the code implementing macvtap allows for a user-specified device name, so we should allow it. In the case that an interface name starts with "macvtap" or "macvlan" though, we do still clear it out, just as we do with "vnet" (which is the prefix used for automatically generated tap device names), since those are the prefixes for the names we autogenerate for macvtap and macvlan devices. Resolves: https://bugzilla.redhat.com/1335798 squash --- docs/formatdomain.html.in | 6 +++--- src/conf/domain_conf.c | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index e31a271..58cd3cf 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5175,9 +5175,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 <i>should not - start with either 'vnet' or 'vif'</i>, 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'</i>, + which are prefixes reserved by libvirt and certain hypervisors. + Manually specified targets using these prefixes may be ignored. </p> <p> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fe9b7c7..36644b8 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" @@ -10028,8 +10029,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; -- 2.9.3

... with VIR_NET_GENERATED_MACV???_PREFIX, which is defined in util/virnetdevmacvlan.h. Since VIR_NET_GENERATED_PREFIX is used for plain tap devices, it is renamed to VIR_NET_GENERATED_TAP_PREFIX and moved to virnetdev.h --- src/bhyve/bhyve_command.c | 4 ++-- src/conf/domain_conf.c | 4 ++-- src/conf/domain_conf.h | 4 ---- src/interface/interface_backend_udev.c | 2 +- src/qemu/qemu_interface.c | 8 ++++---- src/uml/uml_conf.c | 4 ++-- src/util/virnetdev.h | 5 +++++ 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index e9c072b..eae5cb3 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -88,10 +88,10 @@ bhyveBuildNetArgStr(virConnectPtr conn, } if (!net->ifname || - STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) || + STRPREFIX(net->ifname, VIR_NET_GENERATED_TAP_PREFIX) || strchr(net->ifname, '%')) { VIR_FREE(net->ifname); - if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_PREFIX "%d") < 0) + if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_TAP_PREFIX "%d") < 0) goto cleanup; } diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 36644b8..236e028 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -9745,7 +9745,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, ifname = virXMLPropString(cur, "dev"); if (ifname && (flags & VIR_DOMAIN_DEF_PARSE_INACTIVE) && - (STRPREFIX(ifname, VIR_NET_GENERATED_PREFIX) || + (STRPREFIX(ifname, VIR_NET_GENERATED_TAP_PREFIX) || (prefix && STRPREFIX(ifname, prefix)))) { /* An auto-generated target name, blank it out */ VIR_FREE(ifname); @@ -22150,7 +22150,7 @@ virDomainNetDefFormat(virBufferPtr buf, if (def->ifname && !((flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE) && - (STRPREFIX(def->ifname, VIR_NET_GENERATED_PREFIX) || + (STRPREFIX(def->ifname, VIR_NET_GENERATED_TAP_PREFIX) || (prefix && STRPREFIX(def->ifname, prefix))))) { /* Skip auto-generated target names for inactive config. */ virBufferEscapeString(buf, "<target dev='%s'/>\n", def->ifname); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3b6b174..95848f7 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1040,10 +1040,6 @@ struct _virDomainNetDef { virNetDevCoalescePtr coalesce; }; -/* Used for prefix of ifname of any network name generated dynamically - * by libvirt, and cannot be used for a persistent network name. */ -# define VIR_NET_GENERATED_PREFIX "vnet" - typedef enum { VIR_DOMAIN_CHR_DEVICE_STATE_DEFAULT = 0, VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED, diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index 18a45fa..1cd8406 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -570,7 +570,7 @@ udevBridgeScanDirFilter(const struct dirent *entry) * vnet%d. Improvements to this check are welcome. */ if (strlen(entry->d_name) >= 5) { - if (STRPREFIX(entry->d_name, VIR_NET_GENERATED_PREFIX) && + if (STRPREFIX(entry->d_name, VIR_NET_GENERATED_TAP_PREFIX) && c_isdigit(entry->d_name[4])) return 0; } diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index d0850c0..d8a678b 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -428,10 +428,10 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def, } if (!net->ifname || - STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) || + STRPREFIX(net->ifname, VIR_NET_GENERATED_TAP_PREFIX) || strchr(net->ifname, '%')) { VIR_FREE(net->ifname); - if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_PREFIX "%d") < 0) + if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_TAP_PREFIX "%d") < 0) goto cleanup; /* avoid exposing vnet%d in getXMLDesc or error outputs */ template_ifname = true; @@ -528,10 +528,10 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def, } if (!net->ifname || - STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) || + STRPREFIX(net->ifname, VIR_NET_GENERATED_TAP_PREFIX) || strchr(net->ifname, '%')) { VIR_FREE(net->ifname); - if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_PREFIX "%d") < 0) + if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_TAP_PREFIX "%d") < 0) goto cleanup; /* avoid exposing vnet%d in getXMLDesc or error outputs */ template_ifname = true; diff --git a/src/uml/uml_conf.c b/src/uml/uml_conf.c index bdef783..9bd4f11 100644 --- a/src/uml/uml_conf.c +++ b/src/uml/uml_conf.c @@ -112,10 +112,10 @@ umlConnectTapDevice(virDomainDefPtr vm, int tapfd = -1; if (!net->ifname || - STRPREFIX(net->ifname, VIR_NET_GENERATED_PREFIX) || + STRPREFIX(net->ifname, VIR_NET_GENERATED_TAP_PREFIX) || strchr(net->ifname, '%')) { VIR_FREE(net->ifname); - if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_PREFIX "%d") < 0) + if (VIR_STRDUP(net->ifname, VIR_NET_GENERATED_TAP_PREFIX "%d") < 0) goto error; /* avoid exposing vnet%d in getXMLDesc or error outputs */ template_ifname = true; diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index 19036cc..c7494cd 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -37,6 +37,11 @@ typedef struct ifreq virIfreq; typedef void virIfreq; # endif +/* Used for prefix of ifname of any tap device name generated + * dynamically by libvirt, cannot be used for a persistent network name. + */ +# define VIR_NET_GENERATED_TAP_PREFIX "vnet" + typedef enum { VIR_NETDEV_RX_FILTER_MODE_NONE = 0, VIR_NETDEV_RX_FILTER_MODE_NORMAL, -- 2.9.3

On Tue, Apr 25, 2017 at 02:50:34PM -0400, Laine Stump wrote:
The parser had been clearing out *all* suggested device names for type='direct' (aka macvtap) interfaces. All of the code implementing macvtap allows for a user-specified device name, so we should allow it. In the case that an interface name starts with "macvtap" or "macvlan" though, we do still clear it out, just as we do with "vnet" (which is the prefix used for automatically generated tap device names), since those are the prefixes for the names we autogenerate for macvtap and macvlan devices.
Resolves: https://bugzilla.redhat.com/1335798
Changes since V1:
* make a single #define for each of MACVLAN_PREFIX and MACVTAP_PREFIX in virnetdevmacvlan.h rather than duplicating #defines from virnetdevmacvlan.c into domain_conf.h (as suggested by Martin
* move/rename the auto-generated prefix for regular tap devices to be consistent with the macvtap/macvlan prefixes.
Laine Stump (3): util: make macvtap/macvlan generated name #defines available to other files conf: don't ignore <target dev='blah'/> for macvtap interfaces util: rename/move VIR_NET_GENERATED_PREFIX to be consistent
docs/formatdomain.html.in | 6 ++-- src/bhyve/bhyve_command.c | 4 +-- src/conf/domain_conf.c | 11 ++++-- src/conf/domain_conf.h | 4 --- src/interface/interface_backend_udev.c | 2 +- src/qemu/qemu_interface.c | 8 ++--- src/uml/uml_conf.c | 4 +-- src/util/virnetdev.h | 5 +++ src/util/virnetdevmacvlan.c | 65 ++++++++++++++-------------------- src/util/virnetdevmacvlan.h | 6 ++++ 10 files changed, 57 insertions(+), 58 deletions(-)
ACK series. I, personally, am voting for more features and fixes that actually remove code ;)
-- 2.9.3
participants (2)
-
Laine Stump
-
Martin Kletzander