From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5ehD-0001Ln-KM for qemu-devel@nongnu.org; Tue, 21 Jan 2014 12:01:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5eh8-0004mk-GT for qemu-devel@nongnu.org; Tue, 21 Jan 2014 12:01:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:12920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5eh7-0004mM-VK for qemu-devel@nongnu.org; Tue, 21 Jan 2014 12:00:58 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0LH0t3O023690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 21 Jan 2014 12:00:55 -0500 Message-ID: <52DEA7C5.9050400@redhat.com> Date: Tue, 21 Jan 2014 10:00:53 -0700 From: Eric Blake MIME-Version: 1.0 References: <4cd22b3505eff19fd2492cd4e60120810714f97e.1390321064.git.jcody@redhat.com> In-Reply-To: <4cd22b3505eff19fd2492cd4e60120810714f97e.1390321064.git.jcody@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m5lokk5dXJo8B7iddnfehiSudGh2RJaC9" Subject: Re: [Qemu-devel] [PATCH v2 2/3] block: resize backing image during active layer commit, if needed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , qemu-devel@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m5lokk5dXJo8B7iddnfehiSudGh2RJaC9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/21/2014 09:31 AM, Jeff Cody wrote: > If the top image to commit is the active layer, and also larger than > the base image, then an I/O error will likely be returned during > block-commit. >=20 > For instance, if we have a base image with a virtual size 10G, and a > active layer image of size 20G, then committing the snapshot via > 'block-commit' will likely fail. >=20 > This will automatically attempt to resize the base image, if the > active layer image to be committed is larger. >=20 > Signed-off-by: Jeff Cody > --- > block/mirror.c | 36 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 36 insertions(+) >=20 > + if (length > base_length) { > + if (bdrv_truncate(base, length) < 0) { > + error_setg(errp, "Top image %s is larger than base image %= s, and " > + "resize of base image failed.", We typically don't use trailing '.' in error messages. But that's small enough that I'm okay adding: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --m5lokk5dXJo8B7iddnfehiSudGh2RJaC9 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS3qfFAAoJEKeha0olJ0NqhOkIAK8QNYWvs4bHyW6HSjyk3b2i 5PICiUK0Vj1YEx5AWUWF52Dn7L8F2RFjZrUwiIT6NtexB/j8ppLsTG7qKl/NkLhG bJ8LfCr9REQsHDr9qG22cD+GDjT2xRJJcqF19PJeGahadOa6w64yPiQ+yYsQ8Smc H9xa751YEqgy3LmB5Cm13moO4FhE74AVLOG8EysybLy02CqnincGCKbpDwqVpi9q afSm93R/UUeWf/fpqlYlIP38rgppSmoIfaKgYiSLCsjzNx7/CvtwvgKoUVBD7ilr ZEDLeD1q1A2gsi2ACkVQ5FfCoeLX9w/hf1xxx6btjKvO7vTiJf8rkfDPJ/b9zd4= =iSJ6 -----END PGP SIGNATURE----- --m5lokk5dXJo8B7iddnfehiSudGh2RJaC9--