qemu-e2k/qapi
Eric Blake 5d72c68b49 qcow2: Expose bitmaps' size during measure
It's useful to know how much space can be occupied by qcow2 persistent
bitmaps, even though such metadata is unrelated to the guest-visible
data.  Report this value as an additional QMP field, present when
measuring an existing image and output format that both support
bitmaps.  Update iotest 178 and 190 to updated output, as well as new
coverage in 190 demonstrating non-zero values made possible with the
recently-added qemu-img bitmap command (see 3b51ab4b).

The new 'bitmaps size:' field is displayed automatically as part of
'qemu-img measure' any time it is present in QMP (that is, any time
both the source image being measured and destination format support
bitmaps, even if the measurement is 0 because there are no bitmaps
present).  If the field is absent, it means that no bitmaps can be
copied (source, destination, or both lack bitmaps, including when
measuring based on size rather than on a source image).  This behavior
is compatible with an upcoming patch adding 'qemu-img convert
--bitmaps': that command will fail in the same situations where this
patch omits the field.

The addition of a new field demonstrates why we should always
zero-initialize qapi C structs; while the qcow2 driver still fully
populates all fields, the raw and crypto drivers had to be tweaked to
avoid uninitialized data.

Consideration was also given towards having a 'qemu-img measure
--bitmaps' which errors out when bitmaps are not possible, and
otherwise sums the bitmaps into the existing allocation totals rather
than displaying as a separate field, as a potential convenience
factor.  But this was ultimately decided to be more complexity than
necessary when the QMP interface was sufficient enough with bitmaps
remaining a separate field.

See also: https://bugzilla.redhat.com/1779904

Reported-by: Nir Soffer <nsoffer@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20200521192137.1120211-3-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
2020-05-28 13:16:16 -05:00
..
audio.json audio/jack: add JACK client audiodev 2020-05-25 11:30:03 +02:00
authz.json
block-core.json qcow2: Expose bitmaps' size during measure 2020-05-28 13:16:16 -05:00
block.json qapi: Mark deprecated QMP parts with feature 'deprecated' 2020-03-17 21:43:12 +01:00
char.json qapi: Belatedly update doc comment for @wait deprecation 2020-03-17 19:58:34 +01:00
common.json
control.json qapi: Mark deprecated QMP parts with feature 'deprecated' 2020-03-17 21:43:12 +01:00
crypto.json
dump.json
error.json
introspect.json qapi: Add feature flags to struct members 2020-03-17 21:25:47 +01:00
job.json
machine-target.json
machine.json Add rx-softmmu 2020-03-19 17:58:05 +01:00
Makefile.objs qemu-storage-daemon: Add --monitor option 2020-03-06 17:21:28 +01:00
migration.json migration/xbzrle: add encoding rate 2020-05-07 17:40:24 +01:00
misc-target.json
misc.json qapi: Mark deprecated QMP parts with feature 'deprecated' 2020-03-17 21:43:12 +01:00
net.json net: Complete qapi-fication of netdev_add 2020-03-17 21:50:14 +01:00
opts-visitor.c
pragma.json qapi: Create 'pragma' module 2020-03-06 17:21:28 +01:00
qapi-clone-visitor.c
qapi-dealloc-visitor.c qapi: Fix Visitor contract for start_alternate() 2020-04-30 06:51:15 +02:00
qapi-schema.json qapi: Create 'pragma' module 2020-03-06 17:21:28 +01:00
qapi-util.c
qapi-visit-core.c qapi: Assert non-input visitors see only valid narrow integers 2020-04-30 07:26:40 +02:00
qdev.json
qmp-dispatch.c qmp: fix leak on callbacks that return both value and error 2020-04-02 14:55:46 -04:00
qmp-event.c
qmp-registry.c qmp: constify QmpCommand and list 2020-03-17 21:43:12 +01:00
qobject-input-visitor.c qobject: Eliminate qdict_iter(), use qdict_first(), qdict_next() 2020-04-30 06:51:15 +02:00
qobject-output-visitor.c
qom.json qapi: Flatten object-add 2020-03-06 17:21:27 +01:00
rdma.json
rocker.json
run-state.json
sockets.json qemu-sockets: add abstract UNIX domain socket support 2020-05-20 10:34:40 +01:00
string-input-visitor.c
string-output-visitor.c
tpm.json
trace-events
trace.json
transaction.json qemu-storage-daemon: Add --monitor option 2020-03-06 17:21:28 +01:00
ui.json