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

Matthias Bolte matthias.bolte at googlemail.com
Fri Jul 8 14:34:18 UTC 2011


2011/7/8 Daniel P. Berrange <berrange at redhat.com>:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> 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




More information about the libvir-list mailing list