From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5yCV-0005FF-TR for qemu-devel@nongnu.org; Tue, 20 Sep 2011 07:09:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5yCR-000073-Cq for qemu-devel@nongnu.org; Tue, 20 Sep 2011 07:09:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5yCR-00006z-5f for qemu-devel@nongnu.org; Tue, 20 Sep 2011 07:09:15 -0400 From: Kevin Wolf Date: Tue, 20 Sep 2011 13:11:46 +0200 Message-Id: <1316517112-9908-15-git-send-email-kwolf@redhat.com> In-Reply-To: <1316517112-9908-1-git-send-email-kwolf@redhat.com> References: <1316517112-9908-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 14/20] rbd: ignore failures when reading from default conf location List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Sage Weil 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 --- block/rbd.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/block/rbd.c b/block/rbd.c index 1b78d51..f64b2e0 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') { -- 1.7.6.2