block: Change bitmap truncate conditional to assertion
PATCH 1/1 block: Change bitmap truncate conditional to assertion
Requires: [email protected]
[PATCH] block: record new size in bdrv_dirty_bitmap_truncate
This is an artifact of an older version that had both all-bitmap and single-bitmap truncate functions, and some info got lost in the shuffle.
Bitmaps can only be frozen during a backup operation, and a backup operation should prevent a resize operation, so just assert that this cannot happen.
--- block.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block.c +1 -3
@@ -3220,9 +3220,7 @@ static void bdrv_dirty_bitmap_truncate(BlockDriverState *bs)uint64_t size =bdrv_nb_sectors (bs); QLIST_FOREACH(bitmap, &bs->dirty_bitmaps, list) { -if (bdrv_dirty_bitmap_frozen (bitmap)) { -continue ; - } +assert (!bdrv_dirty_bitmap_frozen (bitmap));hbitmap_truncate (bitmap->bitmap, size); bitmap->size = size; }
Signature · 1 line
2.1.0
Quoted 3 lines · John Snow
Requires: [email protected]
[PATCH] block: record new size inbdrv_dirty_bitmap_truncate
Shouldn't this be after the '---' separator?
Quoted 7 lines
This is an artifact of an older version that had both all-bitmap and single-bitmap truncate functions, and some info got lost in the shuffle.
Bitmaps can only be frozen during a backup operation, and a backup operation should prevent a resize operation, so just assert that this cannot happen.
Quoted 5 lines
Suggested-by Kevin Wolf <[email protected]>Signed-off-by John Snow <[email protected]>--- block.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Quoted 7 lines · Eric Blake
Quoted 3 lines · John Snow
Requires: [email protected] [PATCH] block: record new size in
bdrv_dirty_bitmap_truncateShouldn't this be after the '---' separator?
Sorry, not used to sending single patches without a cover letter.
Kevin: If it's not inconvenient for you to do, please delete these lines on commit.
Quoted 8 lines
Quoted 8 lines
This is an artifact of an older version that had both all-bitmap and single-bitmap truncate functions, and some info got lost in the shuffle.
Bitmaps can only be frozen during a backup operation, and a backup operation should prevent a resize operation, so just assert that this cannot happen.
Quoted 6 lines
Quoted 3 lines
Suggested-by Kevin Wolf <[email protected]> Signed-off-by: JohnSnow <[email protected]> ---
block.c| 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Reviewed-by Eric Blake <[email protected]>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJVeKQoAAoJEH3vgQaq/DkO4bAQAIDn75jog313WnsmZ7uRPNQ3 qhCOGUjr4e2S80k7o/blQjXm8eZZjijBPPCmqT68uX5JI9JXcuMRCkbALGSzI7nt U4GidZWYd+D1G97DYfDCpEeKmaRLgoG8OOxnuUIGZIAmmf8NMlTFtNczFeFNwzWC LhVh+aQHyoxsDlIrkHPDyMcGm0LTZ5aWsOx/FhaRjKP0pEm6bAav7pxovjlxsc1R GyVch0wpOyqppKmvaZ3tQGMPCQksoLGSBrAG6q89Ip9LsdFcPphUg0Wee1RMgrbx zKOaI5+vA8dOTpVZqQ03/AOnJLUwgaePupDn9L03LXrmrKDbVV9huUes+aUfyNnM iGdmQRtmQfjQKa0svCsRqtgzPoCNnnDDvuPcSzVFj8+hU01zqnf29peS8bSkTqeW xPoTiIp2+lfmegd2Va/NYoVk+qQo5iDGZshTtjRhkGx5tqKt6RikZT7f3UTPeG8i 1PZM9k6J9zAtrjHyBHwrWo+naFSDwl0iXwtxj/NjZ0nyiLE4yCq5ucWQowITpSin qh8KDLuMP0zCXDSdfQAiO/adxAisiVcOXSomdGJKmY/DiU9wkFYKT3paicASplky /X8DN4Gs0dKx93wl0NDGMTO4+i8KE7uC1HBuFE7YomFYexWGQ7EBPqjb7RyFsSjq il//J7BQPXDhkwId1jHF
=ck4X
-----END PGP SIGNATURE-----
Kevin Wolf
AppliedAm 10.06.2015 um 22:55 hat John Snow geschrieben:
Quoted 6 lines · Eric Blake
Quoted 5 lines · John Snow
Quoted 3 lines
Requires: [email protected] [PATCH] block: record new size in
bdrv_dirty_bitmap_truncate
Quoted 7 lines
Quoted 2 lines
Shouldn't this be after the '---' separator?
Sorry, not used to sending single patches without a cover letter.
Kevin: If it's not inconvenient for you to do, please delete these lines on commit.
No problem.
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
This is an artifact of an older version that had both all-bitmap and single-bitmap truncate functions, and some info got lost in the shuffle.
Bitmaps can only be frozen during a backup operation, and a backup operation should prevent a resize operation, so just assert that this cannot happen.
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines
Suggested-by Kevin Wolf <[email protected]> Signed-off-by: JohnSnow <[email protected]> ---
block.c| 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)Reviewed-by Eric Blake <[email protected]>
Thanks, applied to the block branch.
Kevin