]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'remotes/ericb/tags/pull-bitmaps-2020-09-21' into staging
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 23 Sep 2020 14:11:38 +0000 (15:11 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 23 Sep 2020 14:11:38 +0000 (15:11 +0100)
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>
1  2 
qemu-img.c

diff --combined qemu-img.c
index 3b7700c780d80f0808e03d40f70f19855cf0da46,d79c6ffa2e4902348446bafab2a7155624f0f0b2..2103507936ea5b6fff3710cc9953886fd890db6a
@@@ -1188,7 -1188,7 +1188,7 @@@ static int64_t find_nonzero(const uint8
   * 'pnum' is set to the number of sectors (including and immediately following
   * the first one) that are known to be in the same allocated/unallocated state.
   * The function will try to align the end offset to alignment boundaries so
 - * that the request will at least end aligned and consequtive requests will
 + * that the request will at least end aligned and consecutive requests will
   * also start at an aligned offset.
   */
  static int is_allocated_sectors(const uint8_t *buf, int n, int *pnum,
@@@ -4779,14 -4779,19 +4779,19 @@@ static int img_bitmap(int argc, char **
      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;
          }