From c54483b6f45a0c84e230728a1a9e7adf90345e15 Mon Sep 17 00:00:00 2001 From: Andrey Drobyshev Date: Tue, 11 Jul 2023 20:25:51 +0300 Subject: block: add subcluster_size field to BlockDriverInfo This is going to be used in the subsequent commit as requests alignment (in particular, during copy-on-read). This value only makes sense for the formats which support subclusters (currently QCOW2 only). If this field isn't set by driver's own bdrv_get_info() implementation, we simply set it equal to the cluster size thus treating each cluster as having a single subcluster. Reviewed-by: Eric Blake Reviewed-by: Denis V. Lunev Signed-off-by: Andrey Drobyshev Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Stefan Hajnoczi Message-ID: <20230711172553.234055-2-andrey.drobyshev@virtuozzo.com> --- include/block/block-common.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/block/block-common.h b/include/block/block-common.h index e15395f..df5ffc8 100644 --- a/include/block/block-common.h +++ b/include/block/block-common.h @@ -132,6 +132,11 @@ typedef struct BlockZoneWps { typedef struct BlockDriverInfo { /* in bytes, 0 if irrelevant */ int cluster_size; + /* + * A fraction of cluster_size, if supported (currently QCOW2 only); if + * disabled or unsupported, set equal to cluster_size. + */ + int subcluster_size; /* offset at which the VM state can be saved (0 if not possible) */ int64_t vm_state_offset; bool is_dirty; -- cgit v1.1