Skip to content
Commit 863cc78f authored by Sam Eiderman's avatar Sam Eiderman Committed by Max Reitz
Browse files

qemu-img: rebase: Reduce reads on in-chain rebase



In the following case:

(base) A <- B <- C (tip)

when running:

    qemu-img rebase -b A C

QEMU would read all sectors not allocated in the file being rebased (C)
and compare them to the new base image (A), regardless of whether they
were changed or even allocated anywhere along the chain between the new
base and the top image (B). This causes many unneeded reads when
rebasing an image which represents a small diff of a large disk, as it
would read most of the disk's sectors.

Instead, use bdrv_is_allocated_above() to reduce the number of
unnecessary reads.

Reviewed-by: default avatarKarl Heubaum <karl.heubaum@oracle.com>
Signed-off-by: default avatarSam Eiderman <shmuel.eiderman@oracle.com>
Signed-off-by: default avatarEyal Moscovici <eyal.moscovici@oracle.com>
Message-id: 20190523163337.4497-3-shmuel.eiderman@oracle.com
Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
parent 4ebe0617
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment