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 <kwolf@redhat.com>
This commit is contained in:
Kevin Wolf 2012-12-06 14:32:55 +01:00
parent b83c18e225
commit 312a2ba0eb
1 changed files with 5 additions and 0 deletions

View File

@ -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;