From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgygf-0006lk-UM for qemu-devel@nongnu.org; Wed, 22 Oct 2014 12:23:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xgyga-0005YG-RU for qemu-devel@nongnu.org; Wed, 22 Oct 2014 12:23:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgyga-0005Y1-Iq for qemu-devel@nongnu.org; Wed, 22 Oct 2014 12:22:56 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9MGMt2g028729 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 22 Oct 2014 12:22:56 -0400 Message-ID: <5447D9DE.50705@redhat.com> Date: Wed, 22 Oct 2014 10:22:54 -0600 From: Eric Blake MIME-Version: 1.0 References: <1413982283-10186-1-git-send-email-mreitz@redhat.com> <1413982283-10186-9-git-send-email-mreitz@redhat.com> In-Reply-To: <1413982283-10186-9-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KbKsf4Bf3JF424lPU2RRnNpG3IPmLs6Bx" Subject: Re: [Qemu-devel] [PATCH v13 08/14] qemu-img: Implement commit like QMP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Igor Mammedov , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KbKsf4Bf3JF424lPU2RRnNpG3IPmLs6Bx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/22/2014 06:51 AM, Max Reitz wrote: > qemu-img should use QMP commands whenever possible in order to ensure > feature completeness of both online and offline image operations. As > qemu-img itself has no access to QMP (since this would basically requir= e > just everything being linked into qemu-img), imitate QMP's > implementation of block-commit by using commit_active_start() and then > waiting for the block job to finish. >=20 > Signed-off-by: Max Reitz > --- > block/Makefile.objs | 3 +- > qemu-img.c | 82 ++++++++++++++++++++++++++++++++++++++++-----= -------- > 2 files changed, 64 insertions(+), 21 deletions(-) >=20 > +done: > blk_unref(blk); > - if (ret) { > + > + if (local_err) { > + qerror_report_err(local_err); > + error_free(local_err); > return 1; Igor has a patch that simplifies this style of cleanup: https://lists.gnu.org/archive/html/qemu-devel/2014-10/msg01992.html But it does so by using exit(1) instead of return 1, not to mention that there are probably a lot of places in qemu-img.c that could be similarly cleaned at the same time as a separate patch. So for this patch, as-is, Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KbKsf4Bf3JF424lPU2RRnNpG3IPmLs6Bx 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUR9neAAoJEKeha0olJ0NqlK4IAIVOSOOeiFolP1NoDF4lNNhv fsO1ZUoR79ziwG4S0ZwJr9KFlWgZSFQbT2HD3YiXartBE/9wcXC2GLYbp+JqOywV +PBBOcqHv4o8BpSFSM1h9H1Ge/c5BWvm4XWkiYiy9sD8KEyXZUVV8/brP6hoCe4w 06sNDnEalCFTdn4wumO2eS9bN4MVj3mxLKzIe36ERmQAC7jGRwe9CXdyzabuiKnG zTiKLSuAWu/xYy3FFGrl7CCVa95cFQKEjFCS1JEqnQZ4itJWbj7n8Te+qqUtkG7V ZC0um0ZqklttEdCjZz9wMjbvW5bi/y0HwdEQ4KIutdi4NDLCp3RtQvpP2fb69Ug= =tjMx -----END PGP SIGNATURE----- --KbKsf4Bf3JF424lPU2RRnNpG3IPmLs6Bx--