From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljg67-0006QZ-E1 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ljg61-0006Na-Oc for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:14 -0400 Received: from [199.232.76.173] (port=57237 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljg61-0006NS-CO for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:09 -0400 Received: from mx1.redhat.com ([66.187.233.31]:45034) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ljg61-0004Iz-2q for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:41:09 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n2HKf8dk020265 for ; Tue, 17 Mar 2009 16:41:08 -0400 From: Uri Lublin Date: Tue, 17 Mar 2009 22:40:44 +0200 Message-Id: <1237322452-11337-7-git-send-email-uril@redhat.com> In-Reply-To: <1237322452-11337-6-git-send-email-uril@redhat.com> References: <1237322452-11337-1-git-send-email-uril@redhat.com> <1237322452-11337-2-git-send-email-uril@redhat.com> <1237322452-11337-3-git-send-email-uril@redhat.com> <1237322452-11337-4-git-send-email-uril@redhat.com> <1237322452-11337-5-git-send-email-uril@redhat.com> <1237322452-11337-6-git-send-email-uril@redhat.com> Subject: [Qemu-devel] [PATCH 06/14] block-qcow2: export highest-alloc through BlockDriverInfo and get_info() Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Uri Lublin Signed-off-by: Uri Lublin --- block-qcow2.c | 1 + block.h | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/block-qcow2.c b/block-qcow2.c index c070e05..53364ff 100644 --- a/block-qcow2.c +++ b/block-qcow2.c @@ -1763,6 +1763,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/block.h b/block.h index fab01e6..c01b192 100644 --- a/block.h +++ b/block.h @@ -26,6 +26,8 @@ typedef struct BlockDriverInfo { int cluster_size; /* offset at which the VM state can be saved (0 if not possible) */ int64_t vm_state_offset; + /* highest allocated block offset (in bytes) */ + int64_t highest_alloc; } BlockDriverInfo; typedef struct QEMUSnapshotInfo { -- 1.6.0.6