[PATCH 02/10] linkstate: Public API for modifying link state on interfaces

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

 



This API adds methods to modify link state of virtual
interfaces of a domain.

Idea of this API is to enable simulation of unplugging
(virtual) cable from the machine to test networks or
to allow propagation of topology changes on the host.
---
 include/libvirt/libvirt.h.in |   24 ++++++++++++++++++++++++
 src/libvirt_public.syms      |    6 ++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index b1bda31..b149eb9 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -1022,6 +1022,30 @@ int                     virDomainGetControlInfo (virDomainPtr domain,
                                                  virDomainControlInfoPtr info,
                                                  unsigned int flags);

+
+/*
+ * Domain network interface link state modification
+ */
+
+int                     virDomainInterfaceLinkSetState(virDomainPtr dom,
+                                                       const char *path,
+                                                       unsigned int state,
+                                                       unsigned int flags);
+int                     virDomainInterfaceLinkGetState(virDomainPtr dom,
+                                                       const char *path,
+                                                       unsigned int flags);
+/**
+ * virInterfaceLinkStates
+ *
+ * Link state options
+ */
+typedef enum {
+    VIR_LINK_STATE_DEFAULT = 0, /* Default link state (up) */
+    VIR_LINK_STATE_UP,          /* Link is up. ("cable" connected) */
+    VIR_LINK_STATE_DOWN ,       /* Link is down. ("cable" disconnected) */
+} virInterfaceLinkStates;
+
+
 /*
  * Return scheduler type in effect 'sedf', 'credit', 'linux'
  */
diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms
index c2b6666..ac77c02 100644
--- a/src/libvirt_public.syms
+++ b/src/libvirt_public.syms
@@ -481,3 +481,9 @@ LIBVIRT_0.9.4 {
 } LIBVIRT_0.9.3;

 # .... define new API here using predicted next version number ....
+
+LIBVIRT_0.9.5 {
+    global:
+        virDomainInterfaceLinkSetState;
+        virDomainInterfaceLinkGetState;
+} LIBVIRT_0.9.4;
-- 
1.7.6

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]