[Libguestfs] [PATCH v2 2/2] daemon: add udev_settle_file to is_root_device

Richard W.M. Jones rjones at redhat.com
Thu Apr 13 16:07:12 UTC 2017


On Thu, Apr 13, 2017 at 05:55:27PM +0300, Pavel Butsykin wrote:
> It fixes a fail with ENOENT when device is not yet present after system boot.
> 
> Signed-off-by: Pavel Butsykin <pbutsykin at virtuozzo.com>
> ---
>  daemon/guestfsd.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
> index b82c98acd..e6a4c65c4 100644
> --- a/daemon/guestfsd.c
> +++ b/daemon/guestfsd.c
> @@ -404,6 +404,9 @@ int
>  is_root_device (const char *device)
>  {
>    struct stat statbuf;
> +
> +  udev_settle_file (device);
> +
>    if (stat (device, &statbuf) == -1) {
>      perror (device);
>      return 0;

This one is fine now, so ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list