summaryrefslogtreecommitdiffstats
path: root/qemu-img.c
diff options
context:
space:
mode:
authorPeter Maydell2020-09-23 16:11:38 +0200
committerPeter Maydell2020-09-23 16:11:38 +0200
commitc122bca9cd7b986be4d473240a4fec6315b7a2c2 (patch)
treeffe93494e45ab1ae727044b578f7019edbe0481c /qemu-img.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/input-20200921-pull-request... (diff)
parentqemu-img: Support bitmap --merge into backing image (diff)
downloadqemu-c122bca9cd7b986be4d473240a4fec6315b7a2c2.tar.gz
qemu-c122bca9cd7b986be4d473240a4fec6315b7a2c2.tar.xz
qemu-c122bca9cd7b986be4d473240a4fec6315b7a2c2.zip
Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-09-21' into staging
bitmaps patches for 2020-09-21 - Eric Blake: Improve 'qemu-img bitmap --merge' by not opening backing images # gpg: Signature made Tue 22 Sep 2020 01:58:31 BST # gpg: using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full] # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full] # gpg: aka "[jpeg image of size 6874]" [full] # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-bitmaps-2020-09-21: qemu-img: Support bitmap --merge into backing image Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 3b7700c780..2103507936 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4779,14 +4779,19 @@ static int img_bitmap(int argc, char **argv)
filename = argv[optind];
bitmap = argv[optind + 1];
- blk = img_open(image_opts, filename, fmt, BDRV_O_RDWR, false, false,
- false);
+ /*
+ * No need to open backing chains; we will be manipulating bitmaps
+ * directly in this image without reference to image contents.
+ */
+ blk = img_open(image_opts, filename, fmt, BDRV_O_RDWR | BDRV_O_NO_BACKING,
+ false, false, false);
if (!blk) {
goto out;
}
bs = blk_bs(blk);
if (src_filename) {
- src = img_open(false, src_filename, src_fmt, 0, false, false, false);
+ src = img_open(false, src_filename, src_fmt, BDRV_O_NO_BACKING,
+ false, false, false);
if (!src) {
goto out;
}