From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEG4z-0007Cu-DR for qemu-devel@nongnu.org; Tue, 27 Aug 2013 06:00:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEG4t-0000dN-Dd for qemu-devel@nongnu.org; Tue, 27 Aug 2013 06:00:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEG4t-0000dB-6O for qemu-devel@nongnu.org; Tue, 27 Aug 2013 06:00:47 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7RA0jJb024233 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 27 Aug 2013 06:00:46 -0400 Message-ID: <521C78CB.2050301@redhat.com> Date: Tue, 27 Aug 2013 12:00:43 +0200 From: Max Reitz MIME-Version: 1.0 References: <1377522260-16676-1-git-send-email-mreitz@redhat.com> <1377522260-16676-2-git-send-email-mreitz@redhat.com> <20130827095445.GA648@dhcp-200-207.str.redhat.com> In-Reply-To: <20130827095445.GA648@dhcp-200-207.str.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/5] qcow2: Add corrupt bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Stefan Hajnoczi 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 >> --- [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