]> git.ipfire.org Git - thirdparty/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)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Jun 2020 00:41:42 +0000 (19:41 -0500)
commitfa446ae444d7daa24971f74888771120de0b5f97
treeeedbc6c324a490871780cca01ab63bf12d0058f2
parent3fb2521040478adbec767eac83ec6a78ad0c610d
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>
(cherry picked from commit a1db8733d28d615bc0daeada6c406a6dd5c5d5ef)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-bitmap.c