From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgbZu-0003cr-5N for qemu-devel@nongnu.org; Thu, 06 Dec 2012 08:33:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TgbZZ-0003Y1-Fk for qemu-devel@nongnu.org; Thu, 06 Dec 2012 08:33:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TgbZZ-0003Xq-0Q for qemu-devel@nongnu.org; Thu, 06 Dec 2012 08:33:05 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qB6DX4qv025403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Dec 2012 08:33:04 -0500 From: Kevin Wolf Date: Thu, 6 Dec 2012 14:32:55 +0100 Message-Id: <1354800780-10683-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1354800780-10683-1-git-send-email-kwolf@redhat.com> References: <1354800780-10683-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 1/6] blkdebug: Allow usage without config file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com As soon as new rules can be set during runtime, as introduced by the next patch, blkdebug makes sense even without a config file. Signed-off-by: Kevin Wolf --- block/blkdebug.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index d61ece8..c9041ec 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -240,6 +240,11 @@ static int read_config(BDRVBlkdebugState *s, const char *filename) int ret; struct add_rule_data d; + /* Allow usage without config file */ + if (!*filename) { + return 0; + } + f = fopen(filename, "r"); if (f == NULL) { return -errno; -- 1.7.6.5