From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54481) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPurR-0003j6-6x for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:51:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPurK-0002W2-Gj for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:51:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPurK-0002Vy-8z for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:51:30 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s85EpTnu002639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Sep 2014 10:51:29 -0400 Message-ID: <5409CDF0.20604@redhat.com> Date: Fri, 05 Sep 2014 08:51:28 -0600 From: Eric Blake MIME-Version: 1.0 References: <1409926039-29044-1-git-send-email-mreitz@redhat.com> <1409926039-29044-2-git-send-email-mreitz@redhat.com> <5409CB55.9000401@redhat.com> <5409CD0D.2040409@redhat.com> In-Reply-To: <5409CD0D.2040409@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OiRCmNp0aWBVDcMlBva0oCwQ4uc0eenFj" 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 , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OiRCmNp0aWBVDcMlBva0oCwQ4uc0eenFj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/05/2014 08:47 AM, Max Reitz wrote: > On 05.09.2014 16:40, Eric Blake wrote: >> On 09/05/2014 08:07 AM, Max Reitz wrote: >>> Not every BLOCK_IMAGE_CORRUPTED event must be fatal; for example, whe= n >>> reading from an image, they should generally not be. Nonetheless, eve= n >>> 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 sho= uld >>> be emitted, but the image should not be marked corrupt (in accordance= to >>> "fatal" set to false). >>> >> Question - what happens if management misses the signal? For example,= >> if libvirt opens qemu on a read-only image, then goes away, then >> corruption is detected, then libvirt reconnects. Does query-block nee= d >> to also be updated to report whether a read-only BDS is currently >> detected as fatal, but that an event has already been delivered? >=20 > Well, the obvious problem with that is that corruption currently is a > strongly format-specific topic, and only reported for qcow2. So, to do > this, we'd have to move the corruption signalling code into the common > block layer functions and proceed from there. This actually probably > isn't too bad of an idea, anyway. But then we'll need a global > bdrv_mark_corrupt() function (which we probably don't want in case we > get more flags in the future, so we'll rather want bdrv_set_flag() or > something) and I don't really want to make these changes now... We coul= d > postpone this, though. Making this change later shouldn't break anythin= g. >=20 > The other solution would be simply to suppress the stderr message but t= o > always deliver the QMP event. That feels like it would flood the channel, if the image is being repeatedly read. The approach of warning exactly once is nice because it prevents flooding. We already have a way to report per-format details, is it sufficient to modify ImageInfoSpecificQCow2 to add a bool field that reports true if the image is currently known to be corrupted? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --OiRCmNp0aWBVDcMlBva0oCwQ4uc0eenFj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUCc3wAAoJEKeha0olJ0NqNisH/iKhh9wpzSoJEdzZOnkHVjw1 e3bmVObEUvSbqTWmApLEk+Y47s36Rj/hNtwnnJ0ENZ4SPVhe0BgmxkTcGKYxWwpq sBcpSwuzaSREMicf2AG78kaJSNp6fuEqK7LxJGKwgAh03cnvPkpof2zmpHL6G7e4 g7SCRzRXlh2zAo4ikfIB0zx+8Ap/Vjqqk0BKVh+dkMaNXCpjdaLsEnUlAkwI+fRz X4J9jtKmkxkM2XmlPYJoNPOT5CIT6jpohX3dcKOsf3myaczi4arlMHc1ZPDISbuM Kkl31tW6IvRXEH8NMrOMp1b3nrUABzdPoZWhvSBxroKxwr17M7yV0wsemxSlkIM= =TyJH -----END PGP SIGNATURE----- --OiRCmNp0aWBVDcMlBva0oCwQ4uc0eenFj--