qemu-img: Add convert --bitmaps option
commit8c8b6d6475c62f4937cacad214d7ba7a23080685
authorEric Blake <eblake@redhat.com>
Wed, 13 May 2020 01:16:47 +0000 (12 20:16 -0500)
committerEric Blake <eblake@redhat.com>
Thu, 21 May 2020 19:15:39 +0000 (21 14:15 -0500)
tree78dc6ce794c61e034045455ee8af6417b1510d8a
parentad518b3a5d4e6f354cc257604e77bfa774133a73
qemu-img: Add convert --bitmaps option

Make it easier to copy all the persistent bitmaps of (the top layer
of) a source image along with its guest-visible contents, by adding a
boolean flag for use with qemu-img convert.  This is basically
shorthand, as the same effect could be accomplished with a series of
'qemu-img bitmap --add' and 'qemu-img bitmap --merge -b source'
commands, or by their corresponding QMP commands.

Note that this command will fail in the same scenarios where 'qemu-img
measure' omits a 'bitmaps size:' line, namely, when either the source
or the destination lacks persistent bitmap support altogether.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1779893

While touching this, clean up a couple coding issues spotted in the
same function: an extra blank line, and merging back-to-back 'if
(!skip_create)' blocks.

Signed-off-by: Eric Blake <eblake@redhat.com>
docs/tools/qemu-img.rst
qemu-img-cmds.hx
qemu-img.c