提交 f9fe18ec 编写于 作者: S Sage Weil 提交者: Kevin Wolf

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: NSage Weil <sage@newdream.net>
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
上级 a26a13da
...@@ -298,11 +298,8 @@ static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options) ...@@ -298,11 +298,8 @@ static int qemu_rbd_create(const char *filename, QEMUOptionParameter *options)
} }
if (strstr(conf, "conf=") == NULL) { if (strstr(conf, "conf=") == NULL) {
if (rados_conf_read_file(cluster, NULL) < 0) { /* try default location, but ignore failure */
error_report("error reading config file"); rados_conf_read_file(cluster, NULL);
rados_shutdown(cluster);
return -EIO;
}
} }
if (conf[0] != '\0' && if (conf[0] != '\0' &&
...@@ -441,11 +438,8 @@ static int qemu_rbd_open(BlockDriverState *bs, const char *filename, int flags) ...@@ -441,11 +438,8 @@ static int qemu_rbd_open(BlockDriverState *bs, const char *filename, int flags)
} }
if (strstr(conf, "conf=") == NULL) { if (strstr(conf, "conf=") == NULL) {
r = rados_conf_read_file(s->cluster, NULL); /* try default location, but ignore failure */
if (r < 0) { rados_conf_read_file(s->cluster, NULL);
error_report("error reading config file");
goto failed_shutdown;
}
} }
if (conf[0] != '\0') { if (conf[0] != '\0') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册