From d6e9098e10e82feeddb824d7c3d0cf61aff96c29 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 31 Mar 2010 14:40:27 +0200 Subject: Replace calls of old bdrv_open What is known today as bdrv_open2 becomes the new bdrv_open. All remaining callers of the old function are converted to the new one. In some places they even know the right format, so they should have used bdrv_open2 from the beginning. Signed-off-by: Kevin Wolf --- qemu-img.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'qemu-img.c') diff --git a/qemu-img.c b/qemu-img.c index 9b28664a30..18e43a0075 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -210,7 +210,7 @@ static BlockDriverState *bdrv_new_open(const char *filename, if (!readonly) { flags |= BDRV_O_RDWR; } - if (bdrv_open2(bs, filename, flags, drv) < 0) { + if (bdrv_open(bs, filename, flags, drv) < 0) { error("Could not open '%s'", filename); } if (bdrv_is_encrypted(bs)) { @@ -415,7 +415,7 @@ static int img_check(int argc, char **argv) } else { drv = NULL; } - if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) { + if (bdrv_open(bs, filename, BRDV_O_FLAGS, drv) < 0) { error("Could not open '%s'", filename); } ret = bdrv_check(bs); @@ -474,7 +474,7 @@ static int img_commit(int argc, char **argv) } else { drv = NULL; } - if (bdrv_open2(bs, filename, BRDV_O_FLAGS | BDRV_O_RDWR, drv) < 0) { + if (bdrv_open(bs, filename, BRDV_O_FLAGS | BDRV_O_RDWR, drv) < 0) { error("Could not open '%s'", filename); } ret = bdrv_commit(bs); @@ -926,7 +926,7 @@ static int img_info(int argc, char **argv) } else { drv = NULL; } - if (bdrv_open2(bs, filename, BRDV_O_FLAGS | BDRV_O_NO_BACKING, drv) < 0) { + if (bdrv_open(bs, filename, BRDV_O_FLAGS | BDRV_O_NO_BACKING, drv) < 0) { error("Could not open '%s'", filename); } bdrv_get_format(bs, fmt_name, sizeof(fmt_name)); @@ -1032,7 +1032,7 @@ static int img_snapshot(int argc, char **argv) if (!bs) error("Not enough memory"); - if (bdrv_open2(bs, filename, bdrv_oflags, NULL) < 0) { + if (bdrv_open(bs, filename, bdrv_oflags, NULL) < 0) { error("Could not open '%s'", filename); } @@ -1137,7 +1137,7 @@ static int img_rebase(int argc, char **argv) } flags = BRDV_O_FLAGS | BDRV_O_RDWR | (unsafe ? BDRV_O_NO_BACKING : 0); - if (bdrv_open2(bs, filename, flags, drv) < 0) { + if (bdrv_open(bs, filename, flags, drv) < 0) { error("Could not open '%s'", filename); } @@ -1169,7 +1169,7 @@ static int img_rebase(int argc, char **argv) bs_old_backing = bdrv_new("old_backing"); bdrv_get_backing_filename(bs, backing_name, sizeof(backing_name)); - if (bdrv_open2(bs_old_backing, backing_name, BRDV_O_FLAGS, + if (bdrv_open(bs_old_backing, backing_name, BRDV_O_FLAGS, old_backing_drv)) { error("Could not open old backing file '%s'", backing_name); @@ -1177,7 +1177,7 @@ static int img_rebase(int argc, char **argv) } bs_new_backing = bdrv_new("new_backing"); - if (bdrv_open2(bs_new_backing, out_baseimg, BRDV_O_FLAGS | BDRV_O_RDWR, + if (bdrv_open(bs_new_backing, out_baseimg, BRDV_O_FLAGS | BDRV_O_RDWR, new_backing_drv)) { error("Could not open new backing file '%s'", out_baseimg); -- cgit v1.2.3