From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQleK-0002MZ-1L for qemu-devel@nongnu.org; Mon, 30 Sep 2013 18:09:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQleC-0006kY-US for qemu-devel@nongnu.org; Mon, 30 Sep 2013 18:09:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQleC-0006kG-Kt for qemu-devel@nongnu.org; Mon, 30 Sep 2013 18:08:56 -0400 Message-ID: <5249F675.50501@redhat.com> Date: Mon, 30 Sep 2013 16:08:53 -0600 From: Eric Blake MIME-Version: 1.0 References: <1378695482-29805-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1378695482-29805-7-git-send-email-xiawenc@linux.vnet.ibm.com> In-Reply-To: <1378695482-29805-7-git-send-email-xiawenc@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="G5XTa0aIFtM54oioieCIVD2qSvKbnG0XS" Subject: Re: [Qemu-devel] [PATCH V3 6/7] qcow2: print message for error path in snapshot creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --G5XTa0aIFtM54oioieCIVD2qSvKbnG0XS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09/08/2013 08:58 PM, Wenchao Xia wrote: > The message will be print out with a macro enabled, which can s/print/printed/ > be used to check which error path is taken. >=20 > Signed-off-by: Wenchao Xia > --- > block/qcow2-snapshot.c | 46 ++++++++++++++++++++++++++++++++++++++++= ++++++ > 1 files changed, 46 insertions(+), 0 deletions(-) >=20 > @@ -381,12 +413,20 @@ int qcow2_snapshot_create(BlockDriverState *bs, Q= EMUSnapshotInfo *sn_info) > ret =3D qcow2_pre_write_overlap_check(bs, QCOW2_OL_DEFAULT, > sn->l1_table_offset, s->l1_size * sizeof(uint64_t)); > if (ret < 0) { > +#ifdef QCOW2_SNAPSHOT_PRINT_ERROR_PATH > + printf("qcow2: Failed in overlap check before update L1 table = for " > + "snapshot\n"); > +#endif > goto dealloc_cluster; > } > =20 > + BLKDBG_EVENT(bs->file, BLKDBG_SNAPSHOT_L1_UPDATE); Should this BLKDBG be part of patch 5? In general, the move to avoid fprintf except under recompilation seems okay; but it seems odd to be removing the diagnosis altogether. If you had gone one step further and refactored the code to wire in Error* support, then you could change fprintf to passing the Error back up the stack to the caller rather than losing it except during a debug build. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --G5XTa0aIFtM54oioieCIVD2qSvKbnG0XS 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.4.14 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJSSfZ1AAoJEKeha0olJ0Nq7t4H/jAJ/L/dmwHNcfE7mKt7InLN UIyJe09BtM48wIxsKhmnXQMOXSIGgwztCRQVn8ZIzz4hWXFdRHbmYjzShL5l3DDX uWuT8IpLhFenWHD2BV5DkPIZ+VXnCAAYcB2x6NkleS2VF6H3Lrix86QM/UraVXTs PJoTD0lZGA0FXt1Qd85yIL2yIh4AdkaGeSwmbgL1OEoAdBqnXC5orJ+wTeUBwg9H 5lWVQprkKyU6S7SC4T/UM/Wn8GQzOyR5EP+/k4i46EkukrxKnHq8t2cmis3uj1Df tLrN6EGVhl6ngUfNslTDFvZWY+sjY3YKZcXEBBX6+6IYLQ51uCp6ga2pAgMmpDc= =q5+6 -----END PGP SIGNATURE----- --G5XTa0aIFtM54oioieCIVD2qSvKbnG0XS--