qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 03/14] qcow2: Optimize bdrv_make_empty()


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v6 03/14] qcow2: Optimize bdrv_make_empty()
Date: Tue, 29 Apr 2014 17:13:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 29.04.2014 17:07, Max Reitz wrote:
bdrv_make_empty() is currently only called if the current image
represents an external snapshot that has been committed to its base
image; it is therefore unlikely to have internal snapshots. In this
case, bdrv_make_empty() can be greatly sped up by creating an empty L1
table and dropping all data clusters at once by recreating the refcount
structure accordingly instead of normally discarding all clusters.

If there are snapshots, fall back to the simple implementation (discard
all clusters).

Signed-off-by: Max Reitz <address@hidden>
---
  block/qcow2.c | 385 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
  1 file changed, 370 insertions(+), 15 deletions(-)

If someone is interested in how I got to the calculation of the cluster size (which I hope there is, as I probably did some mistake somewhere and I'd be glad if someone other than me could verify the correctness :-P), I've attached a PDF with the transformation steps.

Max

Attachment: blob-calculation.pdf
Description: Adobe PDF document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]