[libvirt] [PATCH 1/3] qemu: fix ethernet network type ip/route assign

Laine Stump laine at laine.org
Thu Aug 25 05:57:58 UTC 2016


From: Vasiliy Tolstov <v.tolstov at selfip.ru>

The call to virNetDevIPInfoAddToDev() that sets up tap device IP
addresses and routes was somehow incorrectly placed in
qemuInterfaceStopDevice() instead of qemuInterfaceStartDevice().  This
fixes that error by moving the call to virNetDevIPInfoAddToDev() to
qemuInterfaceStartDevice().

Signed-off-by: Vasiliy Tolstov <v.tolstov at selfip.ru>
---
 src/qemu/qemu_interface.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c
index e637d21..e327133 100644
--- a/src/qemu/qemu_interface.c
+++ b/src/qemu/qemu_interface.c
@@ -108,8 +108,13 @@ qemuInterfaceStartDevice(virDomainNetDefPtr net)
         break;
     }
 
-    case VIR_DOMAIN_NET_TYPE_USER:
     case VIR_DOMAIN_NET_TYPE_ETHERNET:
+        if (virNetDevIPInfoAddToDev(net->ifname, &net->hostIP) < 0)
+            goto cleanup;
+
+        break;
+
+    case VIR_DOMAIN_NET_TYPE_USER:
     case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
     case VIR_DOMAIN_NET_TYPE_SERVER:
     case VIR_DOMAIN_NET_TYPE_CLIENT:
@@ -197,10 +202,6 @@ qemuInterfaceStopDevice(virDomainNetDefPtr net)
     }
 
     case VIR_DOMAIN_NET_TYPE_ETHERNET:
-        if (virNetDevIPInfoAddToDev(net->ifname, &net->hostIP) < 0)
-            goto cleanup;
-        break;
-
     case VIR_DOMAIN_NET_TYPE_USER:
     case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
     case VIR_DOMAIN_NET_TYPE_SERVER:
-- 
2.7.4




More information about the libvir-list mailing list