qemu-devel
[Top][All Lists]
Advanced

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

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


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v9 03/14] qcow2: Optimize bdrv_make_empty()
Date: Wed, 09 Jul 2014 23:38:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 09.07.2014 23:22, Paolo Bonzini wrote:
Il 05/07/2014 19:47, Max Reitz ha scritto:
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).

How much of this code could be reused by bdrv_create?

Currently, none. The latest version of Hu Tao's preallocation series reuses minimal_blob_size().

The point of this code is to empty an image at runtime while keeping it consistent all the time. bdrv_open() does not have that problem; there are no pre-existing structures, therefore it can just go and create them. bdrv_make_empty() has to be careful (in this version) not to overwrite any data or metadata while relocating the structures.

Kevin proposed another version which just marks the image dirty, clears the L1 table, relocates it and then writes minimal refcount structures. This will be shorted and in principle similar to how bdrv_open() works, but isn't worth sharing either.

Max



reply via email to

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