Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
rbd: ignore failures when reading from default conf location
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
liewegas committed Sep 9, 2011
1 parent d984dee commit 090738a
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit 090738a

Please sign in to comment.