From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQzWM-0004w0-7q for qemu-devel@nongnu.org; Mon, 08 Sep 2014 10:02:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XQzWE-0005XD-IE for qemu-devel@nongnu.org; Mon, 08 Sep 2014 10:02:18 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:59477 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XQzWE-0005X7-Bg for qemu-devel@nongnu.org; Mon, 08 Sep 2014 10:02:10 -0400 Date: Mon, 8 Sep 2014 16:01:18 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140908140118.GC22582@irqsave.net> References: <1409926039-29044-1-git-send-email-mreitz@redhat.com> <1409926039-29044-2-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1409926039-29044-2-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 1/5] qapi/block: Add "fatal" to BLOCK_IMAGE_CORRUPTED List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi The Friday 05 Sep 2014 =E0 16:07:15 (+0200), Max Reitz wrote : > Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, when > reading from an image, they should generally not be. Nonetheless, even > an image only read from may of course be corrupted and this can be > detected during normal operation. In this case, a non-fatal event shoul= d > be emitted, but the image should not be marked corrupt (in accordance t= o > "fatal" set to false). >=20 > Signed-off-by: Max Reitz > --- > block/qcow2-refcount.c | 1 + > qapi/block-core.json | 9 +++++++-- > 2 files changed, 8 insertions(+), 2 deletions(-) >=20 > diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c > index 43665b8..0bd75d2 100644 > --- a/block/qcow2-refcount.c > +++ b/block/qcow2-refcount.c > @@ -1853,6 +1853,7 @@ int qcow2_pre_write_overlap_check(BlockDriverStat= e *bs, int ign, int64_t offset, > offset, > true, > size, > + true, What is this line ? > &error_abort); > g_free(message); > =20 > diff --git a/qapi/block-core.json b/qapi/block-core.json > index a685d02..d23bcc2 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -1554,7 +1554,7 @@ > ## > # @BLOCK_IMAGE_CORRUPTED > # > -# Emitted when a disk image is being marked corrupt > +# Emitted when a corruption has been detected in a disk image > # > # @device: device name > # > @@ -1568,13 +1568,18 @@ > # @size: #optional, if the corruption resulted from an image access, t= his is > # the access size > # > +# fatal: if set, the image is marked corrupt and therefore unusable af= ter this > +# event and must be repaired (Since 2.2; before, every > +# BLOCK_IMAGE_CORRUPTED event was fatal) > +# > # Since: 1.7 > ## > { 'event': 'BLOCK_IMAGE_CORRUPTED', > 'data': { 'device' : 'str', > 'msg' : 'str', > '*offset': 'int', > - '*size' : 'int' } } > + '*size' : 'int', > + 'fatal' : 'bool' } } > =20 > ## > # @BLOCK_IO_ERROR > --=20 > 2.1.0 >=20 >=20