Am 27.08.2013 11:54, schrieb Kevin Wolf:
Am 26.08.2013 um 15:04 hat Max Reitz geschrieben:
This adds an incompatible bit indicating corruption to qcow2. Any image
with this bit set may not be written to unless for repairing (and
subsequently clearing the bit if the repair has been successful).

Signed-off-by: Max Reitz <mre...@redhat.com>
---
[snip]
@@ -402,6 +433,14 @@ static int qcow2_open(BlockDriverState *bs, QDict 
*options, int flags)
          goto fail;
      }
+ if (s->incompatible_features & QCOW2_INCOMPAT_CORRUPT) {
+        /* Corrupt images may not be written to unless they are being repaired 
*/
+        if ((flags & BDRV_O_RDWR) && !(flags & BDRV_O_REPAIR)) {
Isn't BDRV_O_REPAIR equivalent to BDRV_O_CHECK && BDRV_O_RDWR, or is
there an advantage in using a new bit?

Looks good otherwise.

Kevin
Oh, yes, you're right. I overlooked that flag.

Max

Reply via email to