2015-12-04 09:54:48 +01:00
|
|
|
From 3bff82b57564ffc1fe4fff23f9d121fcf410dd5a Mon Sep 17 00:00:00 2001
|
|
|
|
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
|
|
|
|
Date: Wed, 25 Nov 2015 11:43:56 +0100
|
|
|
|
Subject: [PATCH] Wait for udev events to be handled after removing veth
|
|
|
|
|
|
|
|
As per http://www.redhat.com/archives/libvir-list/2013-July/msg01279.html,
|
|
|
|
wait for udev events to be handled after removing a virtual NIC.
|
|
|
|
Any udev rule associated to NIC destroy could happen to run with a new
|
|
|
|
device with the same name that is being created.
|
|
|
|
---
|
|
|
|
src/lxc/lxc_controller.c | 1 +
|
|
|
|
src/lxc/lxc_driver.c | 2 ++
|
|
|
|
src/lxc/lxc_process.c | 1 +
|
|
|
|
3 files changed, 4 insertions(+)
|
|
|
|
|
2016-04-13 02:22:05 +02:00
|
|
|
Index: libvirt-1.3.3/src/lxc/lxc_controller.c
|
2015-12-18 22:01:20 +01:00
|
|
|
===================================================================
|
2016-04-13 02:22:05 +02:00
|
|
|
--- libvirt-1.3.3.orig/src/lxc/lxc_controller.c
|
|
|
|
+++ libvirt-1.3.3/src/lxc/lxc_controller.c
|
2015-12-18 22:01:20 +01:00
|
|
|
@@ -2002,6 +2002,7 @@ static int virLXCControllerDeleteInterfa
|
2015-12-04 09:54:48 +01:00
|
|
|
if (virNetDevVethDelete(ctrl->veths[i]) < 0)
|
|
|
|
ret = -1;
|
|
|
|
}
|
|
|
|
+ virFileWaitForDevices();
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2016-04-13 02:22:05 +02:00
|
|
|
Index: libvirt-1.3.3/src/lxc/lxc_driver.c
|
2015-12-18 22:01:20 +01:00
|
|
|
===================================================================
|
2016-04-13 02:22:05 +02:00
|
|
|
--- libvirt-1.3.3.orig/src/lxc/lxc_driver.c
|
|
|
|
+++ libvirt-1.3.3/src/lxc/lxc_driver.c
|
2016-03-01 18:58:15 +01:00
|
|
|
@@ -4261,6 +4261,7 @@ lxcDomainAttachDeviceNetLive(virConnectP
|
2015-12-04 09:54:48 +01:00
|
|
|
case VIR_DOMAIN_NET_TYPE_BRIDGE:
|
|
|
|
case VIR_DOMAIN_NET_TYPE_NETWORK:
|
|
|
|
ignore_value(virNetDevVethDelete(veth));
|
|
|
|
+ virFileWaitForDevices();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case VIR_DOMAIN_NET_TYPE_DIRECT:
|
2016-03-01 18:58:15 +01:00
|
|
|
@@ -4689,6 +4690,7 @@ lxcDomainDetachDeviceNetLive(virDomainOb
|
2015-12-04 09:54:48 +01:00
|
|
|
virDomainAuditNet(vm, detach, NULL, "detach", false);
|
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
+ virFileWaitForDevices();
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* It'd be nice to support this, but with macvlan
|
2016-04-13 02:22:05 +02:00
|
|
|
Index: libvirt-1.3.3/src/lxc/lxc_process.c
|
2015-12-18 22:01:20 +01:00
|
|
|
===================================================================
|
2016-04-13 02:22:05 +02:00
|
|
|
--- libvirt-1.3.3.orig/src/lxc/lxc_process.c
|
|
|
|
+++ libvirt-1.3.3/src/lxc/lxc_process.c
|
2015-12-18 22:01:20 +01:00
|
|
|
@@ -221,6 +221,7 @@ static void virLXCProcessCleanup(virLXCD
|
2015-12-04 09:54:48 +01:00
|
|
|
}
|
|
|
|
networkReleaseActualDevice(vm->def, iface);
|
|
|
|
}
|
|
|
|
+ virFileWaitForDevices();
|
|
|
|
|
|
|
|
virDomainConfVMNWFilterTeardown(vm);
|
|
|
|
|