From: Sage Weil Date: Thu, 15 Sep 2011 21:11:08 +0000 (-0700) Subject: rbd: ignore failures when reading from default conf location X-Git-Tag: v1.0-rc0~212^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f9fe18ec772d2852caaa7ca3cb72720d6822edca;p=thirdparty%2Fqemu.git rbd: ignore failures when reading from default conf location 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 Signed-off-by: Kevin Wolf --- diff --git a/block/rbd.c b/block/rbd.c index 1b78d51398b..f64b2e0542a 100644 --- a/block/rbd.c +++ b/block/rbd.c @@ -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') {