mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 06:43:53 -06:00
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 <sage@newdream.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
a26a13da68
commit
f9fe18ec77
1 changed files with 4 additions and 10 deletions
14
block/rbd.c
14
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') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue