From 5f243153c578662262237dff9aaf9214b0a1f2fc Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 24 Aug 2016 19:09:22 +0300 Subject: [PATCH] qemu: fix ethernet network type ip/route assign The call to virNetDevIPInfoAddToDev() that sets up tap device IP addresses and routes was somehow incorrectly placed in qemuInterfaceStopDevice() instead of qemuInterfaceStartDevice() in commit fe8567f6. This fixes that error by moving the call to virNetDevIPInfoAddToDev() to qemuInterfaceStartDevice(). Signed-off-by: Vasiliy Tolstov --- 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 e637d21fb7..e327133308 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: -- GitLab