Re: [PATCH] Don't exist if the libvirtd config does not exist

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

 



2011/7/8 Daniel P. Berrange <berrange@xxxxxxxxxx>:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
>
> It is common for the $HOME/.libvirt/libvirtd.conf file to not
> exist. Treat this situation as non-fatal since we can carry
> on with our default settings just fine.
>
> * daemon/libvirtd.c: Treat ENOENT as non-fatal when loading
>  config
> ---
>  daemon/libvirtd.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
> index 06d2077..fe0fa27 100644
> --- a/daemon/libvirtd.c
> +++ b/daemon/libvirtd.c
> @@ -1028,6 +1028,10 @@ daemonConfigLoad(struct daemonConfig *data,
>  {
>     virConfPtr conf;
>
> +    if (access(filename, R_OK) == -1 &&
> +        errno == ENOENT)
> +        return 0;
> +
>     conf = virConfReadFile (filename, 0);
>     if (!conf)
>         return -1;

s/Don't exist/Don't exit/ typo in subject.

ACK, qemu:///session is working again.

-- 
Matthias Bolte
http://photron.blogspot.com

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