diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-10-07 13:59:03 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-10-20 13:41:26 +0200 |
commit | e4e9986b1caebebdbe53d6f9ad5b03d5ba83f4c3 (patch) | |
tree | 5474e234274b093ee621ebc43730bc666b53af4a /qemu-img.c | |
parent | ec0de76874462c745a1600911bd81ee0253c0c23 (diff) |
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>
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qemu-img.c b/qemu-img.c index 27b85dbda4..9c77dcc927 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -296,7 +296,7 @@ static BlockDriverState *bdrv_new_open(const char *id, Error *local_err = NULL; int ret; - bs = bdrv_new(id, &error_abort); + bs = bdrv_new_root(id, &error_abort); if (fmt) { drv = bdrv_find_format(fmt); @@ -2423,7 +2423,7 @@ static int img_rebase(int argc, char **argv) if (!unsafe) { char backing_name[1024]; - bs_old_backing = bdrv_new("old_backing", &error_abort); + bs_old_backing = bdrv_new_root("old_backing", &error_abort); bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name)); ret = bdrv_open(&bs_old_backing, backing_name, NULL, NULL, src_flags, old_backing_drv, &local_err); @@ -2434,7 +2434,7 @@ static int img_rebase(int argc, char **argv) goto out; } if (out_baseimg[0]) { - bs_new_backing = bdrv_new("new_backing", &error_abort); + bs_new_backing = bdrv_new_root("new_backing", &error_abort); ret = bdrv_open(&bs_new_backing, out_baseimg, NULL, NULL, src_flags, new_backing_drv, &local_err); if (ret) { |