From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPujC-0007HY-Mz for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:43:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPuj7-00089y-Q2 for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:43:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36891) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPuj7-00089t-IA for qemu-devel@nongnu.org; Fri, 05 Sep 2014 10:43:01 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s85Eh1qi030903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Sep 2014 10:43:01 -0400 Message-ID: <5409CBF4.8030909@redhat.com> Date: Fri, 05 Sep 2014 08:43:00 -0600 From: Eric Blake MIME-Version: 1.0 References: <1409926039-29044-1-git-send-email-mreitz@redhat.com> <1409926039-29044-3-git-send-email-mreitz@redhat.com> In-Reply-To: <1409926039-29044-3-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NGKlsIX4U8KTpJTBRUdJPIbq4NrEbmH95" Subject: Re: [Qemu-devel] [PATCH v2 2/5] qcow2: Add qcow2_signal_corruption() 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) --NGKlsIX4U8KTpJTBRUdJPIbq4NrEbmH95 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/05/2014 08:07 AM, Max Reitz wrote: > Add a helper function for easily marking an image corrupt (on fatal > corruptions) while outputting an informative message to stderr and via > QAPI. >=20 > Signed-off-by: Max Reitz > --- > block/qcow2.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ > block/qcow2.h | 5 +++++ > 2 files changed, 53 insertions(+) >=20 > +void qcow2_signal_corruption(BlockDriverState *bs, bool fatal, int64_t= offset, > + int64_t size, const char *message_format,= ...) > +{ > + BDRVQcowState *s =3D bs->opaque; > + char *message; > + va_list ap; > + > + fatal =3D fatal && !bs->read_only; I probably would have written: fatal &=3D !bs->read_only but that's cosmetic. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NGKlsIX4U8KTpJTBRUdJPIbq4NrEbmH95 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 iQEcBAEBCAAGBQJUCcv0AAoJEKeha0olJ0Nqr14H/iRuN5qgjM2MP1mk6qBPrqU0 roxXfu2oLHhLKU/iBvBhujlUuHm8OQ0rMfsZEz2nBBi4XiTR/5ISAb3GGUsPV3Ad rsTb8ow8IZrUF/PXJ7TLc/YdP1cXfMDTOMLwnx225c/ay+/UU1u4C7lFdblDVyWj dGfKmCNT0q29r08AwcsGK77kRJwvfLtw3twC4UfnceRiQVwSX/tGVNCeIRrwQGm/ WXJXwrOjbAlP2ujaKCG5Ovoieqk8VZv5tYAFSpHzPXvQOeXN67/EZBscHyRXK63V ulA/cK5aMpGR+0cHsQxUxDsmpYi0AIduJ5g0o115IXU2aoH55/rovqZjBR4EZt0= =F58f -----END PGP SIGNATURE----- --NGKlsIX4U8KTpJTBRUdJPIbq4NrEbmH95--