block: Split bdrv_new_root() off bdrv_new()

Creating an anonymous BDS can't fail.  Make that obvious.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Benoît Canet <benoit.canet@nodalink.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2014-10-07 13:59:03 +02:00 committed by Kevin Wolf
parent ec0de76874
commit e4e9986b1c
9 changed files with 30 additions and 19 deletions

View file

@ -691,7 +691,7 @@ int main(int argc, char **argv)
drv = NULL;
}
bs = bdrv_new("hda", &error_abort);
bs = bdrv_new_root("hda", &error_abort);
srcpath = argv[optind];
ret = bdrv_open(&bs, srcpath, NULL, NULL, flags, drv, &local_err);