]> git.proxmox.com Git - mirror_qemu.git/commitdiff
rbd: ignore failures when reading from default conf location
authorSage Weil <sage@newdream.net>
Thu, 15 Sep 2011 21:11:08 +0000 (14:11 -0700)
committerKevin Wolf <kwolf@redhat.com>
Tue, 20 Sep 2011 10:27:44 +0000 (12:27 +0200)
If we are reading from the default config location, ignore any failures.
It is perfectly legal for the user to specify exactly the options they need
and to not rely on any config file.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/rbd.c

index 1b78d51398b6d3ad9d7c79ec62fed75c16f7207c..f64b2e0542ac1cd8d98cb71d76695be084aa3618 100644 (file)
@@ -298,11 +298,8 @@ static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options)
     }
 
     if (strstr(conf, "conf=") == NULL) {
-        if (rados_conf_read_file(cluster, NULL) < 0) {
-            error_report("error reading config file");
-            rados_shutdown(cluster);
-            return -EIO;
-        }
+        /* try default location, but ignore failure */
+        rados_conf_read_file(cluster, NULL);
     }
 
     if (conf[0] != '\0' &&
@@ -441,11 +438,8 @@ static int qemu_rbd_open(BlockDriverState *bs, const char *filename, int flags)
     }
 
     if (strstr(conf, "conf=") == NULL) {
-        r = rados_conf_read_file(s->cluster, NULL);
-        if (r < 0) {
-            error_report("error reading config file");
-            goto failed_shutdown;
-        }
+        /* try default location, but ignore failure */
+        rados_conf_read_file(s->cluster, NULL);
     }
 
     if (conf[0] != '\0') {