From 35d2a27fe47c87ecf2b6d3eac1d05ade35ff308c Mon Sep 17 00:00:00 2001 From: aliguori <aliguori> Date: Tue, 3 Mar 2009 16:25:20 +0200 Subject: [PATCH 3/8] block-qcow2: export highest_allocated through BlockDriverInfo and get_info() (Uri Lublin) Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> RH-Upstream-status: applied(qemu/trunk) Bugzilla: 488250 Acked-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Dor Laor <dlaor@redhat.com> --- qemu/block-qcow2.c | 1 + qemu/block.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/qemu/block-qcow2.c b/qemu/block-qcow2.c index 2431018..9175c9d 100644 --- a/qemu/block-qcow2.c +++ b/qemu/block-qcow2.c @@ -1682,6 +1682,7 @@ static int qcow_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) bdi->cluster_size = s->cluster_size; bdi->vm_state_offset = (int64_t)s->l1_vm_state_index << (s->cluster_bits + s->l2_bits); + bdi->highest_alloc = s->highest_alloc << s->cluster_bits; return 0; } diff --git a/qemu/block.h b/qemu/block.h index 5c09113..403065b 100644 --- a/qemu/block.h +++ b/qemu/block.h @@ -25,6 +25,7 @@ typedef struct BlockDriverInfo { int cluster_size; /* offset at which the VM state can be saved (0 if not possible) */ int64_t vm_state_offset; + int64_t highest_alloc; /* highest allocated block offset (in bytes) */ } BlockDriverInfo; typedef struct QEMUSnapshotInfo { -- 1.6.1