[PATCH 4/5] netdev: Enable virNetDevGenerateName to support veth

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Shi Lei <shi_lei@xxxxxxxxxxxxxx>
---
 src/util/virnetdev.c | 2 ++
 src/util/virnetdev.h | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 5ff8e35f..ff1b1fa0 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -102,6 +102,7 @@ VIR_ENUM_IMPL(virNetDevGenNameType,
               "tap",
               "macvtap",
               "macvlan",
+              "veth",
 );
 
 static virNetDevGenName
@@ -110,6 +111,7 @@ virNetDevGenNames[VIR_NET_DEV_GEN_NAME_LAST] = {
     {-1, VIR_NET_GENERATED_TAP_PREFIX, VIR_MUTEX_INITIALIZER},
     {-1, VIR_NET_GENERATED_MACVTAP_PREFIX, VIR_MUTEX_INITIALIZER},
     {-1, VIR_NET_GENERATED_MACVLAN_PREFIX, VIR_MUTEX_INITIALIZER},
+    {-1, VIR_NET_GENERATED_VETH_PREFIX, VIR_MUTEX_INITIALIZER},
 };
 
 typedef enum {
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index 19f37b61..097d0f8e 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -40,6 +40,8 @@ typedef void virIfreq;
  */
 #define VIR_NET_GENERATED_TAP_PREFIX "vnet"
 
+#define VIR_NET_GENERATED_VETH_PREFIX "veth"
+
 /* libvirt will start macvtap/macvlan interface names with one of
  * these prefixes when it auto-generates the name
  */
@@ -156,6 +158,7 @@ typedef enum {
     VIR_NET_DEV_GEN_NAME_TAP,
     VIR_NET_DEV_GEN_NAME_MACVTAP,
     VIR_NET_DEV_GEN_NAME_MACVLAN,
+    VIR_NET_DEV_GEN_NAME_VETH,
     VIR_NET_DEV_GEN_NAME_LAST
 } virNetDevGenNameType;
 
-- 
2.25.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux