Skip to content

RFC qcow2: External data files

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11qcow2: Extend spec for external data filesdocs/interop/qcow2.txt+16 -36 replies
2/11qcow2: Basic definitions for external data filesblock/qcow2.c block/qcow2.h tests/qemu-iotests/031.out +2 more+36 -170 replies
3/11qcow2: Pass bs to qcow2_get_cluster_type()block/qcow2-cluster.c block/qcow2-refcount.c block/qcow2.h+26 -240 replies
4/11qcow2: Prepare qcow2_get_cluster_type() for external data fileblock/qcow2.h+9 -10 replies
5/11qcow2: Prepare count_contiguous_clusters() for external data fileblock/qcow2-cluster.c+2 -20 replies
6/11qcow2: Don't assume 0 is an invalid cluster offsetblock/qcow2-cluster.c block/qcow2.h+29 -323 replies
7/11qcow2: External file I/Oblock/qcow2-bitmap.c block/qcow2-cache.c block/qcow2-cluster.c +4 more+101 -361 reply
8/11qcow2: Add basic data-file infrastructureblock/qcow2.c block/qcow2.h qapi/block-core.json+28 -47 replies
9/11qcow2: Creating images with external data fileblock/qcow2.c include/block/block_int.h qapi/block-core.json+28 -00 replies
10/11qcow2: Store data file name in the imageblock/qcow2.c block/qcow2.h tests/qemu-iotests/082.out+96 -18 replies
11/11qcow2: Add data file to ImageInfoSpecificQCow2block/qcow2.c qapi/block-core.json+6 -17 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [RFC PATCH 00/11] qcow2: External data files

There are use cases where raw images are given (e.g. existing physical disks), but advanced features like dirty bitmaps or backing files are wanted that require use of a proper image format like qcow2.

This series adds an incompatible feature bit to qcow2 which allows to use an external data file: Metadata is kept in the qcow2 file like usual, but guest data is written to an external file. Clusters in the data file are not reference counted, instead we use a flat layout where host cluster offset == guest cluster offset. The external data file is therefore readable as a raw image (though writing to it invalidates the associated qcow2 metadata). Features that require refcounting such as internal snapshots or compression are not supposed in such setups.

There are a few reasons why this is still RFC:

- The resulting code passes qemu-iotests, so we don't regress on normal qcow2 files, but testing with external data files is still minimal (converting an existing image and confirming it reads back unmodified; installing a guest OS and making sure it boots). We need at least some qemu-iotests cases.

- QAPI documentation is missing

- Discard isn't passed through to the data file yet

- s->image_data_file isn't correct, it gets the value from the attached node rather than just from the image file. This means that on header updates we might be writing "back" a path that wasn't there before.

- Probably something else I just can't remember now :-)

Kevin Wolf (11):
qcow2: Extend spec for external data files
qcow2: Basic definitions for external data files
qcow2: Pass bs to qcow2_get_cluster_type()
qcow2: Prepare qcow2_get_cluster_type() for external data file
qcow2: Prepare count_contiguous_clusters() for external data file
qcow2: Don't assume 0 is an invalid cluster offset
qcow2: External file I/O
qcow2: Add basic data-file infrastructure
qcow2: Creating images with external data file
qcow2: Store data file name in the image
qcow2: Add data file to ImageInfoSpecificQCow2

 qapi/block-core.json       |   5 +-
 docs/interop/qcow2.txt     |  19 ++++-
 block/qcow2.h              |  40 +++++++--
 include/block/block_int.h  |   1 +
 block/qcow2-bitmap.c       |   7 +-
 block/qcow2-cache.c        |   6 +-
 block/qcow2-cluster.c      | 144 +++++++++++++++++++-------------
 block/qcow2-refcount.c     |  40 ++++++---
 block/qcow2-snapshot.c     |   7 +-
 block/qcow2.c              | 166 ++++++++++++++++++++++++++++++++++---
 tests/qemu-iotests/031.out |   8 +-
 tests/qemu-iotests/036.out |   4 +-
 tests/qemu-iotests/061.out |  14 ++--
 tests/qemu-iotests/082.out |  27 ++++++
 14 files changed, 372 insertions(+), 116 deletions(-)
Signature · 1 line
2.20.1