[PATCH 1/4] qemu: interface: add qemuDomainDefIsOvsport

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

 



From: zhangjl02 <zhangjl02@xxxxxxxxxx>

Tell whether a port definition is an ovs managed virtual port
---
 src/qemu/qemu_domain.c | 13 +++++++++++++
 src/qemu/qemu_domain.h |  3 +++
 2 files changed, 16 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index fc60e15eea..da5a226fc2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -11575,3 +11575,16 @@ qemuDomainNamePathsCleanup(virQEMUDriverConfig *cfg,
 
     return 0;
 }
+
+/*
+ * Check whether the port is an ovs managed port
+ */
+bool qemuDomainDefIsOvsport(virDomainNetDef *net,
+                         int actualType) {
+    const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net);
+    if ((actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) && vport  &&
+        vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+        return true;
+    }
+    return false;
+}
\ No newline at end of file
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index acf6ca5ab6..81a9bf0cfb 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -1063,3 +1063,6 @@ int
 qemuDomainNamePathsCleanup(virQEMUDriverConfig *cfg,
                            const char *name,
                            bool bestEffort);
+
+bool qemuDomainDefIsOvsport(virDomainNetDef *net,
+        int actualType);
\ No newline at end of file
-- 
2.30.2.windows.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