qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/5] qcow2: Add corrupt bit


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 1/5] qcow2: Add corrupt bit
Date: Tue, 27 Aug 2013 12:00:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

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 <address@hidden>
---
[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

[Prev in Thread] Current Thread [Next in Thread]