[PATCH] Wait for udev events to be handled after removing veth

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

 



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/util/virnetdevveth.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virnetdevveth.c b/src/util/virnetdevveth.c
index 6905168..c8a38fb 100644
--- a/src/util/virnetdevveth.c
+++ b/src/util/virnetdevveth.c
@@ -225,5 +225,8 @@ int virNetDevVethDelete(const char *veth)
     ret = 0;
  cleanup:
     virCommandFree(cmd);
+    /* Make sure the device is properly down: creating a new one
+     * with the same name could lead to troubles */
+    virFileWaitForDevices();
     return ret;
 }
-- 
2.1.4

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