block/dirty-bitmaps: implement inconsistent bit
commit74da6b943565c451d275de1b0253546c5e729d20
authorJohn Snow <jsnow@redhat.com>
Tue, 12 Mar 2019 16:05:49 +0000 (12 12:05 -0400)
committerJohn Snow <jsnow@redhat.com>
Tue, 12 Mar 2019 16:05:49 +0000 (12 12:05 -0400)
treec7fefafb2a403c558cc01c8367028510c6d0b89f
parentcb8e58e3de1a0f39c60de272faa0133b98b02cb5
block/dirty-bitmaps: implement inconsistent bit

Set the inconsistent bit on load instead of rejecting such bitmaps.
There is no way to un-set it; the only option is to delete the bitmap.

Obvervations:
- bitmap loading does not need to update the header for in_use bitmaps.
- inconsistent bitmaps don't need to have their data loaded; they're
  glorified corruption sentinels.
- bitmap saving does not need to save inconsistent bitmaps back to disk.
- bitmap reopening DOES need to drop the readonly flag from inconsistent
  bitmaps to allow reopening of qcow2 files with non-qemu-owned bitmaps
  being eventually flushed back to disk.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20190301191545.8728-8-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
block/qcow2-bitmap.c