[PATCH v3 20/21] lxc: honor link state=up for veth interfaces

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

 



direct interfaces are already brought up when creating them.
---
 src/lxc/lxc_process.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index ed729f6..6f7ff74 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -245,6 +245,7 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
     char *parentVeth;
     char *containerVeth = NULL;
     virNetDevVPortProfilePtr vport = virDomainNetGetActualVirtPortProfile(net);
+    bool vethUp = false;
 
     VIR_DEBUG("calling vethCreate()");
     parentVeth = net->ifname;
@@ -283,6 +284,10 @@ char *virLXCProcessSetupInterfaceBridged(virConnectPtr conn,
         virDomainConfNWFilterInstantiate(conn, vm->uuid, net) < 0)
         goto cleanup;
 
+    vethUp = net->linkstate == VIR_DOMAIN_NET_INTERFACE_LINK_STATE_UP;
+    if (virNetDevSetOnline(containerVeth, vethUp) < 0)
+        goto cleanup;
+
     ret = containerVeth;
 
 cleanup:
-- 
1.8.5.2

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