[Top][All Lists]

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

Re: [Qemu-block] [PATCH 12/22] qcow2-bitmap: add IN_USE flag

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH 12/22] qcow2-bitmap: add IN_USE flag
Date: Mon, 24 Oct 2016 14:35:05 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

24.10.2016 13:32, Vladimir Sementsov-Ogievskiy пишет:
21.10.2016 22:58, Max Reitz пишет:
On 21.10.2016 17:34, Vladimir Sementsov-Ogievskiy wrote:
07.10.2016 22:44, Max Reitz пишет:
On 30.09.2016 12:53, Vladimir Sementsov-Ogievskiy wrote:
This flag means that the bitmap is now in use by the software or was not successfully saved. In any way, with this flag set the bitmap data must
be considered inconsistent and should not be loaded.

With current implementation this flag is never set, as we just remove
bitmaps from the image after loading. But it defined in qcow2 spec and
must be handled. Also, it can be used in future, if async schemes of
bitmap loading/saving are implemented.

We also remove in-use bitmaps from the image on open.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
   block/qcow2-bitmap.c | 17 ++++++++++++++++-
   1 file changed, 16 insertions(+), 1 deletion(-)
Don't you want to make use of this flag? It would appear useful to me if you just marked autoload bitmaps as in_use instead of deleting them from
the image when it's opened and then overwrite them when the image is
And what is the use of it?
You don't need to free any bitmaps when opening the file, and you don't
need to allocate any new bitmap space when closing it.

As bitmaps are sparce in file, I need to allocate new space when closing. Or free it...

Is it a real problem to reallocate space in qcow2? If so, to minimaze allocations, I will have to make a list of clusters of in_use bitmaps on close, and then save current bitmaps to these clusters (and allocated some additional clusters, or free extra clusters).

Also, if I don't free them on open, I'll have to free them on remove of bdrv dirty bitmap..

Any way, storing an invalid copy of online data is bad I think.
Therefore I will have to free bitmap data clusters and zero bitmap table
in file.
Why can't you just set this flag to mark it invalid? In case qemu
crashes, in one case you'll have some invalid bitmaps and in the other
you won't have any of them at all. I don't think there's a difference
from that perspective.


Best regards,

reply via email to

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