]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Don't exit if the libvirtd config does not exist
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 8 Jul 2011 14:27:42 +0000 (15:27 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 8 Jul 2011 15:19:57 +0000 (16:19 +0100)
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

index 06d2077bd403b50c7fb7fb4c136fdf157252519f..fe0fa27f2e4d1b36e5cb9e26b40588e51e6348de 100644 (file)
@@ -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;