From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USFkK-0000hX-Fu for qemu-devel@nongnu.org; Tue, 16 Apr 2013 19:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1USFkJ-0003Zb-EZ for qemu-devel@nongnu.org; Tue, 16 Apr 2013 19:57:08 -0400 Received: from qmta05.emeryville.ca.mail.comcast.net ([76.96.30.48]:59125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1USFkJ-0003ZP-5h for qemu-devel@nongnu.org; Tue, 16 Apr 2013 19:57:07 -0400 Message-ID: <516DE49A.6010606@redhat.com> Date: Tue, 16 Apr 2013 17:54:02 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2VMGRUANRNHJUHJEAGLJH" Subject: Re: [Qemu-devel] [PATCH 08/11] block: update error reporting for bdrv_snapshot_create() and related functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Hrdina Cc: lcapitulino@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2VMGRUANRNHJUHJEAGLJH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/16/2013 10:05 AM, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- > block.c | 23 ++++++++++++++--------- > block/qcow2-snapshot.c | 18 ++++++++++++------ > block/qcow2.h | 4 +++- > block/rbd.c | 20 +++++++++++--------- > block/sheepdog.c | 22 +++++++++++----------- > include/block/block.h | 5 +++-- > include/block/block_int.h | 5 +++-- > qemu-img.c | 8 +++----- > savevm.c | 9 +++++---- > 9 files changed, 65 insertions(+), 49 deletions(-) >=20 > @@ -855,20 +857,20 @@ static int qemu_rbd_snap_create(BlockDriverState = *bs, > */ > if (sn_info->id_str[0] !=3D '\0' && > strcmp(sn_info->id_str, sn_info->name) !=3D 0) { > - return -EINVAL; > + error_setg(errp, "rbd: ID and name have to be equal"); > + return; Who generates sn_info->id_str in the first place? Didn't you just say that the QMP interface does NOT expose user control over id_str, and that it gets populated as a side effect of creation? That says that this error condition is probably dead code, if the QMP command never attempts to generate id_str itself. At any rate, the conversion to errp looks reasonable. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2VMGRUANRNHJUHJEAGLJH 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRbeSaAAoJEKeha0olJ0NqTeMIAIsso9TKedPA4KlMqNLS/pV0 U4sbI5kl27dUbaW3dhR31fnYM/zf5p5aNWLy9N3i/uDqFblbJM487B1smkOd0GQ1 RXmxrPjDikLdYdCW1LRu/G144haK+trskdB5m5prvDWhWjGbjzN0K5j7FjrO+Za7 YJ2fEl9MQugrWm2d19Jh9LtFqU3TGWFIn2ecf/bLzJDl19UkQcw4Oh9Vb2dIuHWL JavawvTzQLdVRcBNSdeG88RJrzr9d5MlvCgwSwEyUqq6s2pO2Lj3z1fAXaWEWBTU NpiKwclv8LJ+ypr5Bm6gDnDRJROMyrOBo6Y6IWnQgs3j2PLkL8WJXfKfm7rfDJc= =ElNC -----END PGP SIGNATURE----- ------enig2VMGRUANRNHJUHJEAGLJH--