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

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

 



On 26.11.2015 09:15, Cédric Bosdonnat wrote:
> 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;
>  }
> 


I'm not fully convinced this is right approach. I mean, we do create
plenty of devices here and there and tear them down. How come this is
the only place causing trouble?
Then, this function you are patching is called in a loop in couple of
places. Wouldn't it be better to wait for udev after the loop and not in it?

Michal

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