summaryrefslogtreecommitdiffstats
path: root/qemu-img-cmds.hx
diff options
context:
space:
mode:
authorEric Blake2020-05-13 03:16:45 +0200
committerEric Blake2020-05-19 19:53:22 +0200
commit3b51ab4bf0f49a01cc2db7b954e0669e081719b5 (patch)
treee932eeb622b2e4c39ed7581daea7b6c8de2f1717 /qemu-img-cmds.hx
parentblockdev: Split off basic bitmap operations for qemu-img (diff)
downloadqemu-3b51ab4bf0f49a01cc2db7b954e0669e081719b5.tar.gz
qemu-3b51ab4bf0f49a01cc2db7b954e0669e081719b5.tar.xz
qemu-3b51ab4bf0f49a01cc2db7b954e0669e081719b5.zip
qemu-img: Add bitmap sub-command
Include actions for --add, --remove, --clear, --enable, --disable, and --merge (note that --clear is a bit of fluff, because the same can be accomplished by removing a bitmap and then adding a new one in its place, but it matches what QMP commands exist). Listing is omitted, because it does not require a bitmap name and because it was already possible with 'qemu-img info'. A single command line can play one or more bitmap commands in sequence on the same bitmap name (although all added bitmaps share the same granularity, and and all merged bitmaps come from the same source file). Merge defaults to other bitmaps in the primary image, but can also be told to merge bitmaps from a distinct image. While this supports --image-opts for the file being modified, I did not think it worth the extra complexity to support that for the source file in a cross-file merges. Likewise, I chose to have --merge only take a single source rather than following the QMP support for multiple merges in one go (although you can still use more than one --merge in the command line); in part because qemu-img is offline and therefore atomicity is not an issue. Upcoming patches will add iotest coverage of these commands while also testing other features. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20200513011648.166876-7-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'qemu-img-cmds.hx')
-rw-r--r--qemu-img-cmds.hx7
1 files changed, 7 insertions, 0 deletions
diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
index cfe8f37587..a87d3cb264 100644
--- a/qemu-img-cmds.hx
+++ b/qemu-img-cmds.hx
@@ -20,6 +20,13 @@ DEF("bench", img_bench,
SRST
.. option:: bench [-c COUNT] [-d DEPTH] [-f FMT] [--flush-interval=FLUSH_INTERVAL] [-i AIO] [-n] [--no-drain] [-o OFFSET] [--pattern=PATTERN] [-q] [-s BUFFER_SIZE] [-S STEP_SIZE] [-t CACHE] [-w] [-U] FILENAME
ERST
+
+DEF("bitmap", img_bitmap,
+ "bitmap (--merge SOURCE | --add | --remove | --clear | --enable | --disable)... [-b source_file [-F source_fmt]] [-g granularity] [--object objectdef] [--image-opts | -f fmt] filename bitmap")
+SRST
+.. option:: bitmap (--merge SOURCE | --add | --remove | --clear | --enable | --disable)... [-b SOURCE_FILE [-F SOURCE_FMT]] [-g GRANULARITY] [--object OBJECTDEF] [--image-opts | -f FMT] FILENAME BITMAP
+ERST
+
DEF("check", img_check,
"check [--object objectdef] [--image-opts] [-q] [-f fmt] [--output=ofmt] [-r [leaks | all]] [-T src_cache] [-U] filename")
SRST