From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKbsG-0002jK-Mi for qemu-devel@nongnu.org; Tue, 26 Mar 2013 17:57:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UKbsF-000143-9o for qemu-devel@nongnu.org; Tue, 26 Mar 2013 17:57:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31306) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UKbsF-00013o-2N for qemu-devel@nongnu.org; Tue, 26 Mar 2013 17:57:43 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2QLvfoq008276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 26 Mar 2013 17:57:42 -0400 Message-ID: <515219D4.7060204@redhat.com> Date: Tue, 26 Mar 2013 15:57:40 -0600 From: Eric Blake MIME-Version: 1.0 References: <668f2843d7a0c1aff3e4eb4a439c7734098bb724.1363957855.git.phrdina@redhat.com> In-Reply-To: <668f2843d7a0c1aff3e4eb4a439c7734098bb724.1363957855.git.phrdina@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2DXWXXUUIIIDTMSSAAIBK" Subject: Re: [Qemu-devel] [PATCH v2 10/12] savevm: update return value from qemu_savevm_state 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) ------enig2DXWXXUUIIIDTMSSAAIBK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/22/2013 07:16 AM, Pavel Hrdina wrote: > Signed-off-by: Pavel Hrdina > --- The commit message could usefully explain _why_ it is okay to collapse all error values into one. As written, the code appears accurate; and the lone caller (do_savevm) handles the new semantics. But this goes back to my question in 9/10 - why not use errp as the witness, and return void, instead of duplicating information? > savevm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/savevm.c b/savevm.c > index 45d1b09..2e5f029 100644 > --- a/savevm.c > +++ b/savevm.c > @@ -1805,7 +1805,7 @@ static int qemu_savevm_state(QEMUFile *f, Error *= *errp) > }; > =20 > if (qemu_savevm_state_blocked(errp)) { > - return -EINVAL; > + return -1; > } > =20 > qemu_mutex_unlock_iothread(); > @@ -1826,7 +1826,7 @@ static int qemu_savevm_state(QEMUFile *f, Error *= *errp) > if (ret !=3D 0) { > qemu_savevm_state_cancel(); > } > - return ret; > + return ret =3D=3D 0 ? 0 : -1; > } > =20 > static int qemu_save_device_state(QEMUFile *f) >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2DXWXXUUIIIDTMSSAAIBK 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/ iQEcBAEBCAAGBQJRUhnUAAoJEKeha0olJ0NqMPMH/0JcpsA8vD7X+nxgRXqjULhJ 9EU3MrFWt3TU6j2R6LG368bGBN2v+EmZrufx/1i4cTcZHLqI4h1ZpC3XCv/u17pg mzvE1LI8t7xQ0ChWGgodvL9KNnAgqUwKm0bKI+56m7WBPHQlr8+o8ktqZKhw9qPO xiZnkkk9u4mJQhQS1IklZZtTehjDsO8Bu75mat0MLSNSwvTojuRYLEhMGgX2Zm8Q Fh3PfevEgHazSaq7TzAXn81hPVAAsUPtAVaaNPV+WBa7dR7ZlZyxI2iNixjNwOuG olJ1bRhES9sVm4MdvanLGBXdRJHU09JFeqLDzi1xb/GT8lE4q3i3bRR9dWI4Wyg= =+wyD -----END PGP SIGNATURE----- ------enig2DXWXXUUIIIDTMSSAAIBK--