From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0UgC-0001FF-FW for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:51:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0Ug6-0007X0-AG for qemu-devel@nongnu.org; Fri, 27 Jun 2014 07:50:56 -0400 Date: Fri, 27 Jun 2014 13:50:32 +0200 From: Stefan Hajnoczi Message-ID: <20140627115032.GN12061@stefanha-thinkpad.muc.redhat.com> References: <53A84797.9040304@gmail.com> <20140624104614.GD3458@noname.redhat.com> <87d2dywoyn.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="b/Q3JWIUAuLE0ZFy" Content-Disposition: inline In-Reply-To: <87d2dywoyn.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH trivial v2] block.c: Add return value for bdrv_append_temp_snapshot() to avoid incorrect failure processing issue List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , famz@redhat.com, Chen Gang , qemu-trivial@nongnu.org, Michael Tokarev , qemu-devel@nongnu.org, mreitz@redhat.com --b/Q3JWIUAuLE0ZFy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 24, 2014 at 01:01:52PM +0200, Markus Armbruster wrote: > Kevin Wolf writes: >=20 > > Am 23.06.2014 um 17:28 hat Chen Gang geschrieben: > >> When failure occurs, 'ret' need be set, or may return 0 to indicate su= ccess. > >> And error_propagate() also need be called only one time within a funct= ion. > >>=20 > >> It is abnormal to prevent bdrv_append_temp_snapshot() return value but= still > >> set errp when error occurs -- although it contents return value intern= ally. > >>=20 > >> So let bdrv_append_temp_snapshot() internal return value outside, and = let > >> all things normal, then fix the issue too. > >>=20 > >> Signed-off-by: Chen Gang > > > > What does this fix? >=20 > It fixes the return value of bdrv_open() when > bdrv_append_temp_snapshot() fails. Before this patch, it returns a > positive value, which is wrong. After the patch, it returns the > negative error code bdrv_append_temp_snapshot() now returns. Exactly. I asked for the -errno return because otherwise bdrv_open() would have no accurate errno. Stefan --b/Q3JWIUAuLE0ZFy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTrVqIAAoJEJykq7OBq3PIXmEIAMIdxsEpHEj3m/HicDIbxqlr mdnEk95JKi5N4EFFfrhbbifRr/JHR/Fs2dIoxoZbvWAzu83ZqhbGTe7c4EZx/BDc TpAEXHjIYpD1fN2yaptoBGqeHQxzX2qxQQskzy9IiLWavuFiv97nLK6X8nMalHJ+ dc48gbYhjCYZxrjuGkVobL0Du6SpXMneTgsMbP3rlO87rfiED/gubxu5bXWlhEjH 5sjoLUx6bauQ94Q4NyrxN9o+8x30qjBH3NslZT3FIu1p4IkGpLG5T25fCBKQi3zL 4WhZUr3NZED9MwvGhuOWzOo7zLehJ0MQswI+v1VLz845WlTl1bIMvju0ZxfoHIg= =qFJz -----END PGP SIGNATURE----- --b/Q3JWIUAuLE0ZFy--