aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorAndrey Drobyshev <andrey.drobyshev@virtuozzo.com>2023-07-11 20:25:51 +0300
committerStefan Hajnoczi <stefanha@redhat.com>2023-08-30 07:39:10 -0400
commitc54483b6f45a0c84e230728a1a9e7adf90345e15 (patch)
tree5bf9bacf290a472997dc5cb756125cf5eb92ba9f /block/qcow2.c
parentf187609f27b261702a17f79d20bf252ee0d4f9cd (diff)
downloadqemu-c54483b6f45a0c84e230728a1a9e7adf90345e15.zip
qemu-c54483b6f45a0c84e230728a1a9e7adf90345e15.tar.gz
qemu-c54483b6f45a0c84e230728a1a9e7adf90345e15.tar.bz2
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 <eblake@redhat.com> Reviewed-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Andrey Drobyshev <andrey.drobyshev@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20230711172553.234055-2-andrey.drobyshev@virtuozzo.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index c51388e..b48cd9c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -5197,6 +5197,7 @@ qcow2_co_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
{
BDRVQcow2State *s = bs->opaque;
bdi->cluster_size = s->cluster_size;
+ bdi->subcluster_size = s->subcluster_size;
bdi->vm_state_offset = qcow2_vm_state_offset(s);
bdi->is_dirty = s->incompatible_features & QCOW2_INCOMPAT_DIRTY;
return 0;