From 4057a2b24a5f5dae826d438217f77332c3a6842e Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 27 Oct 2014 11:12:53 +0100 Subject: block/qcow2: Implement status CB for amend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only really time-consuming operation potentially performed by qcow2_amend_options() is zero cluster expansion when downgrading qcow2 images from compat=1.1 to compat=0.10, so report status of that operation and that operation only through the status CB. For this, approximate the progress as the number of L1 entries visited during the operation. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: BenoƮt Canet Reviewed-by: Kevin Wolf Reviewed-by: Benoit Canet Message-id: 1414404776-4919-5-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi --- block/qcow2.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'block/qcow2.h') diff --git a/block/qcow2.h b/block/qcow2.h index 886b25b..21ac8ce 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -537,7 +537,8 @@ int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors, enum qcow2_discard_type type, bool full_discard); int qcow2_zero_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors); -int qcow2_expand_zero_clusters(BlockDriverState *bs); +int qcow2_expand_zero_clusters(BlockDriverState *bs, + BlockDriverAmendStatusCB *status_cb); /* qcow2-snapshot.c functions */ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info); -- cgit v1.1