]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Mon, 14 Oct 2019 11:51:25 +0000 (14:51 +0300)
committerMax Reitz <mreitz@redhat.com>
Mon, 6 Jan 2020 12:43:06 +0000 (13:43 +0100)
commita1db8733d28d615bc0daeada6c406a6dd5c5d5ef
treedb2fc02bde1b0c2dffdff15d15a4169b6ee1df6e
parent88be15a9e19c5130ecef07f2d01f7030bdf44051
qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap

qcow2_can_store_new_dirty_bitmap works wrong, as it considers only
bitmaps already stored in the qcow2 image and ignores persistent
BdrvDirtyBitmap objects.

So, let's instead count persistent BdrvDirtyBitmaps. We load all qcow2
bitmaps on open, so there should not be any bitmap in the image for
which we don't have BdrvDirtyBitmaps version. If it is - it's a kind of
corruption, and no reason to check for corruptions here (open() and
close() are better places for it).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20191014115126.15360-2-vsementsov@virtuozzo.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-bitmap.c