From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4JD7-00086P-SA for qemu-devel@nongnu.org; Thu, 15 Sep 2011 17:11:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4JD5-0006f0-Qg for qemu-devel@nongnu.org; Thu, 15 Sep 2011 17:11:05 -0400 Received: from cobra.newdream.net ([66.33.216.30]:46097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4JD5-0006eG-AZ for qemu-devel@nongnu.org; Thu, 15 Sep 2011 17:11:03 -0400 From: Sage Weil Date: Thu, 15 Sep 2011 14:11:08 -0700 Message-Id: <1316121071-7690-2-git-send-email-sage@newdream.net> In-Reply-To: <1316121071-7690-1-git-send-email-sage@newdream.net> References: <1316121071-7690-1-git-send-email-sage@newdream.net> Subject: [Qemu-devel] [PATCH 1/4] rbd: ignore failures when reading from default conf location List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, ceph-devel@vger.kernel.org Cc: 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 --- 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.2.5