From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM0rG-00017Y-Ri for qemu-devel@nongnu.org; Wed, 10 Oct 2012 14:18:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TM0r8-0007oB-A8 for qemu-devel@nongnu.org; Wed, 10 Oct 2012 14:18:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TM0r8-0007nu-26 for qemu-devel@nongnu.org; Wed, 10 Oct 2012 14:18:06 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9AII43O024807 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Oct 2012 14:18:04 -0400 Message-ID: <5075BBDB.2090202@redhat.com> Date: Wed, 10 Oct 2012 12:18:03 -0600 From: Eric Blake MIME-Version: 1.0 References: <633f30c7b1812692ca9cd4497f502d5a7366e7e3.1349848348.git.jcody@redhat.com> In-Reply-To: <633f30c7b1812692ca9cd4497f502d5a7366e7e3.1349848348.git.jcody@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigBFE4D02B1D1263E742D0A6B7" Subject: Re: [Qemu-devel] [PATCH 2/2] block: in commit, determine base image from the top image List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigBFE4D02B1D1263E742D0A6B7 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/09/2012 11:56 PM, Jeff Cody wrote: > This simplifies some code and error checking, and also fixes a bug. >=20 > bdrv_find_backing_image() should only be passed absolute filenames, > or filenames relative to the chain. In the QMP message handler for > block commit, when looking up the base do so from the determined top > image, so we know it is reachable from top. >=20 > Signed-off-by: Jeff Cody > --- > block/commit.c | 9 --------- > blockdev.c | 21 +++++++++++---------- > 2 files changed, 11 insertions(+), 19 deletions(-) >=20 > @@ -1182,6 +1172,17 @@ void qmp_block_commit(const char *device, > return; > } > =20 > + if (base && has_base) { > + base_bs =3D bdrv_find_backing_image(top_bs, base); In particular, if I have the chain: /dir1/base <- /dir1/snap1(base) <- /dir2/base(/dir1/snap1) <- /dir2/snap2(base) and request a commit of "top":"/dir1/snap1", "base":"base", then this new code will now look up base relative to /dir1/snap1 and find /dir1/base and proceed with the commit; whereas the old code would look up base relative to /dir2/snap2 and find /dir2/base and complain that the arguments were swapped. I can live with those semantics. Reviewed-by: Eric Blake --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enigBFE4D02B1D1263E742D0A6B7 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.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQdbvbAAoJEKeha0olJ0NqNoMIAIuXiLid6U0rsbhpfB+DHT41 pT5dRqFa/9Kq3/Jp9uvi3Lj+1uAh6FqkA4uMVyOJ5Im1do8F4lp0Rppcv2HZ3IMw sSHgRizq1Qi9hGEJ9K8bKWBIO6lVcszil9P4fRPwbx+xy4DFFt6RdrH9tizwnMRh 9sX3Ggv85bK9qGXMekMRvf8Y46p/ZOErTtM2cAAkyaqzuX17+T8VpGrl4CE3+BXd g6GYyrW+h58pofu6cqNAvzkQ02MxbpVJ32SHVQc646OeRVOL8fAPixipwbePr+1F X1hg5Z/0x5VxGpp8B2lOJOf0CKdT68ZrxGJkINQaQdwyleMMrGpHw174V1DYN34= =eXk/ -----END PGP SIGNATURE----- --------------enigBFE4D02B1D1263E742D0A6B7--