[PATCH 0/3] qemu-img: map: implement support for compressed clusters

Andrey Drobyshev via posted 3 patches 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230607152627.468786-1-andrey.drobyshev@virtuozzo.com
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
There is a newer version of this series
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(-)
[PATCH 0/3] qemu-img: map: implement support for compressed clusters
Posted by Andrey Drobyshev via 11 months ago
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