Received: from eggs.gnu.org ([2001:4830:134:3::10]:36676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMbEh-0000Vu-ND for qemu-devel@nongnu.org; Wed, 27 Aug 2014 07:18:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMbEY-0008Mo-LW for qemu-devel@nongnu.org; Wed, 27 Aug 2014 07:17:55 -0400 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:56580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMbEY-0008M7-EM for qemu-devel@nongnu.org; Wed, 27 Aug 2014 07:17:46 -0400 Received: by mail-we0-f182.google.com with SMTP id k48so60279wev.13 for ; Wed, 27 Aug 2014 04:17:45 -0700 (PDT) Date: Wed, 27 Aug 2014 12:17:40 +0100 From: Stefan Hajnoczi Message-ID: <20140827111740.GG8280@stefanha-thinkpad.redhat.com> References: <1409077076-29855-1-git-send-email-stefanha@redhat.com> <1409077076-29855-4-git-send-email-stefanha@redhat.com> <87r402fnii.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aYDVKSzuImP48n7V" Content-Disposition: inline In-Reply-To: <87r402fnii.fsf@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH 3/3] qemu-img: always goto out in img_snapshot() error paths List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Kevin Wolf , Jeff Cody , jsnow@redhat.com, qemu-devel@nongnu.org, Stefan Hajnoczi --aYDVKSzuImP48n7V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 27, 2014 at 08:35:33AM +0200, Markus Armbruster wrote: > Stefan Hajnoczi writes: >=20 > > The out label has the qemu_progress_end() and other cleanup calls. > > Always goto out in error paths so the cleanup happens. > > > > Note that bdrv_unref(NULL) is safe. We just need to initialize bs to > > NULL at the top of the function. > > > > We can now remove the obsolete bs_old_backing =3D NULL and bs_new_backi= ng > > =3D NULL for safe mode. Originally it was necessary in commit 3e85c6fd > > ("qemu-img rebase") but became useless in commit c2abcce ("qemu-img: > > avoid calling exit(1) to release resources properly") because the > > variables are already initialized during declaration. >=20 > Please mention here that you fix exit code.from -1 to 1. Fixed up when merging --aYDVKSzuImP48n7V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT/b5UAAoJEJykq7OBq3PIjssH/AnoYPodVZKpeXMYugsnQi9o GVMVaGQY2pGJDX81IRCUCyTqCFWXbjT1vqmvxeyG7MOo74AV59NZm295YWXCNbRi LuXZzc0RxzCCAFRd0adYAzKzem07QBjLsFyEZ+gDu+VFMwa4ULZVimavBDwVoo5l wh/odJzl7yYNZU5TwhWICEtYAg73xPKngC6a+LWHv0ICnLnXGMA4DdM7yF4lNU4Z 01Djnke3KFx0RfmcsGe6bVAPhd1g5zalRm2Z5LEUfBnIORm/zump7JS1sBiWfmCj VpBmtY3+NuHmnd6fEY361pJmsRc/eYBr9WZ53zj/ZJ8GNp2rjNOgysnP233cHgs= =E+Vq -----END PGP SIGNATURE----- --aYDVKSzuImP48n7V--