From 312a2ba0eb8ab19646517aeaa785475d3fbcfd51 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 6 Dec 2012 14:32:55 +0100 Subject: blkdebug: Allow usage without config file 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 file changed, 5 insertions(+) (limited to 'block') diff --git a/block/blkdebug.c b/block/blkdebug.c index d61ece86a9..c9041ec3d2 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; -- cgit v1.2.3