[PATCH v2 0/6] qemu-img: Add convert --bitmaps

Eric Blake posted 6 patches 4 years ago
Test docker-mingw@fedora failed
Test docker-quick@centos7 passed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200421212019.170707-1-eblake@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Eric Blake <eblake@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
There is a newer version of this series
docs/tools/qemu-img.rst    |  78 ++++++---
Makefile.objs              |   2 +-
qapi/block-core.json       |  15 +-
include/sysemu/blockdev.h  |  14 ++
block/crypto.c             |   2 +-
block/qcow2.c              |  29 +++-
block/raw-format.c         |   2 +-
blockbitmaps.c             | 324 +++++++++++++++++++++++++++++++++++++
blockdev.c                 | 293 ---------------------------------
qemu-img.c                 | 281 +++++++++++++++++++++++++++++++-
MAINTAINERS                |   1 +
qemu-img-cmds.hx           |  11 +-
tests/qemu-iotests/190     |  15 +-
tests/qemu-iotests/190.out |  13 +-
tests/qemu-iotests/291     | 103 ++++++++++++
tests/qemu-iotests/291.out |  78 +++++++++
tests/qemu-iotests/group   |   1 +
17 files changed, 927 insertions(+), 335 deletions(-)
create mode 100644 blockbitmaps.c
create mode 100755 tests/qemu-iotests/291
create mode 100644 tests/qemu-iotests/291.out
[PATCH v2 0/6] qemu-img: Add convert --bitmaps
Posted by Eric Blake 4 years ago
Without this series, the process for copying one qcow2 image to
another including all of its bitmaps involves running qemu and doing
the copying by hand with a series of QMP commands.  This makes the
process a bit more convenient.

Series can also be downloaded at:
https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/qemu-img-bitmaps-v2

Since v1:
- patches 1, 3 are new
- patch 2 (old 1/3) moves more operations into new file
- patch 4 no longer a separate thread (was at v2 in isolation)
- patches 4, 6 rebased to take advantage of 3
- patch 5, 6 (old 2-3/3) have other minor tweaks

Eric Blake (6):
  docs: Sort sections on qemu-img subcommand parameters
  blockdev: Split off basic bitmap operations for qemu-img
  qemu-img: Add bitmap sub-command
  qcow2: Expose bitmaps' size during measure
  qemu-img: Add convert --bitmaps option
  iotests: Add test 291 to for qemu-img bitmap coverage

 docs/tools/qemu-img.rst    |  78 ++++++---
 Makefile.objs              |   2 +-
 qapi/block-core.json       |  15 +-
 include/sysemu/blockdev.h  |  14 ++
 block/crypto.c             |   2 +-
 block/qcow2.c              |  29 +++-
 block/raw-format.c         |   2 +-
 blockbitmaps.c             | 324 +++++++++++++++++++++++++++++++++++++
 blockdev.c                 | 293 ---------------------------------
 qemu-img.c                 | 281 +++++++++++++++++++++++++++++++-
 MAINTAINERS                |   1 +
 qemu-img-cmds.hx           |  11 +-
 tests/qemu-iotests/190     |  15 +-
 tests/qemu-iotests/190.out |  13 +-
 tests/qemu-iotests/291     | 103 ++++++++++++
 tests/qemu-iotests/291.out |  78 +++++++++
 tests/qemu-iotests/group   |   1 +
 17 files changed, 927 insertions(+), 335 deletions(-)
 create mode 100644 blockbitmaps.c
 create mode 100755 tests/qemu-iotests/291
 create mode 100644 tests/qemu-iotests/291.out

-- 
2.26.2


Re: [PATCH v2 0/6] qemu-img: Add convert --bitmaps
Posted by no-reply@patchew.org 4 years ago
Patchew URL: https://patchew.org/QEMU/20200421212019.170707-1-eblake@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  LINK    qemu-edid.exe
  LINK    qemu-ga.exe
/tmp/qemu-test/src/qemu-img.c: In function 'img_bitmap':
/tmp/qemu-test/src/qemu-img.c:4579:44: error: passing argument 3 of 'qemu_strtosz' from incompatible pointer type [-Werror=incompatible-pointer-types]
             if (qemu_strtosz(optarg, NULL, &granularity)) {
                                            ^~~~~~~~~~~~
In file included from /tmp/qemu-test/src/qemu-img.c:37:
---
 int qemu_strtosz(const char *nptr, const char **end, uint64_t *result);
                                                      ~~~~~~~~~~^~~~~~
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=e06abfa47fc2454097264ac821c5dceb', '-u', '1001', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-d9esijcl/src/docker-src.2020-04-21-18.18.59.19445:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=e06abfa47fc2454097264ac821c5dceb
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-d9esijcl/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    3m19.767s
user    0m8.957s


The full log is available at
http://patchew.org/logs/20200421212019.170707-1-eblake@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
[PATCH] fixup! qemu-img: Add bitmap sub-command
Posted by Eric Blake 4 years ago
Signed-off-by: Eric Blake <eblake@redhat.com>
---

Squash this into patch 3/6 to fix docker-test-mingw@fedora

 qemu-img.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-img.c b/qemu-img.c
index 6cfc1f52ef98..cc87eaf12778 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4529,7 +4529,7 @@ static int img_bitmap(int argc, char **argv)
     BlockBackend *blk = NULL, *src = NULL;
     BlockDriverState *bs = NULL, *src_bs = NULL;
     bool image_opts = false;
-    unsigned long granularity = 0;
+    uint64_t granularity = 0;
     bool add = false, remove = false, clear = false;
     bool enable = false, disable = false, add_disabled = false;
     const char *merge = NULL;
-- 
2.26.2