qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] qemu-img: map: implement support for compressed clusters
@ 2023-06-07 15:26 Andrey Drobyshev via
  2023-06-07 15:26 ` [PATCH 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status() Andrey Drobyshev via
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Andrey Drobyshev via @ 2023-06-07 15:26 UTC (permalink / raw)
  To: qemu-block; +Cc: qemu-devel, kwolf, hreitz, andrey.drobyshev, den

This series adds "compressed" field to the output of "qemu-img map"
command, specifying whether or not data block is compressed.  Only
JSON output mode is affected.  With this applied, output looks like so:

# qemu-img create -f qcow2 img.qcow2 192K
# qemu-io -c "write -c -P 0xaa 0 64K" img.qcow2
# qemu-io -c "write -P 0xbb 64K 64K" img.qcow2
# qemu-img map --output=json img.qcow2

[{ "start": 0, "length": 65536, "depth": 0, "present": true, "zero": false, "data": true, "compressed": true},
{ "start": 65536, "length": 65536, "depth": 0, "present": true, "zero": false, "data": true, "compressed": false, "offset": 393216},
{ "start": 131072, "length": 65536, "depth": 0, "present": false, "zero": true, "data": false, "compressed": false}]

Only formats supporting compression are affected (qcow, qcow2).

Andrey Drobyshev (3):
  block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status()
  qemu-img: map: report compressed data blocks
  qemu-iotests: update expected tests output to contain "compressed"
    field

 block/qcow.c                                  |   5 +-
 block/qcow2.c                                 |   3 +
 include/block/block-common.h                  |   3 +
 qapi/block-core.json                          |   7 +-
 qemu-img.c                                    |  16 +-
 tests/qemu-iotests/122.out                    |  84 ++++----
 tests/qemu-iotests/154.out                    | 194 +++++++++---------
 tests/qemu-iotests/179.out                    | 178 ++++++++--------
 tests/qemu-iotests/244.out                    |  24 +--
 tests/qemu-iotests/252.out                    |  10 +-
 tests/qemu-iotests/274.out                    |  48 ++---
 .../tests/nbd-qemu-allocation.out             |   6 +-
 12 files changed, 300 insertions(+), 278 deletions(-)

-- 
2.31.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-07-06 13:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-07 15:26 [PATCH 0/3] qemu-img: map: implement support for compressed clusters Andrey Drobyshev via
2023-06-07 15:26 ` [PATCH 1/3] block: add BDRV_BLOCK_COMPRESSED flag for bdrv_block_status() Andrey Drobyshev via
2023-06-21 17:08   ` Denis V. Lunev
2023-06-21 17:46     ` Denis V. Lunev
2023-06-21 18:12       ` Andrey Drobyshev
2023-06-07 15:26 ` [PATCH 2/3] qemu-img: map: report compressed data blocks Andrey Drobyshev via
2023-06-21 18:12   ` Denis V. Lunev
2023-07-06 13:10     ` Andrey Drobyshev
2023-07-06 13:51       ` Denis V. Lunev
2023-06-07 15:26 ` [PATCH 3/3] qemu-iotests: update expected tests output to contain "compressed" field Andrey Drobyshev via

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).