From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47727) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AcY-0007Kw-07 for qemu-devel@nongnu.org; Fri, 19 Jul 2013 09:21:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V0AcS-0008AY-JP for qemu-devel@nongnu.org; Fri, 19 Jul 2013 09:21:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58750) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V0AcS-0008AM-AN for qemu-devel@nongnu.org; Fri, 19 Jul 2013 09:21:12 -0400 Message-ID: <51E93D41.4010601@redhat.com> Date: Fri, 19 Jul 2013 07:21:05 -0600 From: Eric Blake MIME-Version: 1.0 References: <1373992168-26043-1-git-send-email-pbonzini@redhat.com> <1373992168-26043-9-git-send-email-pbonzini@redhat.com> In-Reply-To: <1373992168-26043-9-git-send-email-pbonzini@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dMDdUBA3XIRhRMnVCp3X0dtmvRjqE4jgj" Subject: Re: [Qemu-devel] [PATCH v2 08/17] block: make bdrv_has_zero_init return false for copy-on-write-images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: famz@redhat.com, pl@kamp.de, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dMDdUBA3XIRhRMnVCp3X0dtmvRjqE4jgj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/16/2013 10:29 AM, Paolo Bonzini wrote: > This helps implementing is_allocated on top of get_block_status. >=20 > Signed-off-by: Paolo Bonzini > --- > block.c | 5 +++++ > qemu-img.c | 9 +-------- > 2 files changed, 6 insertions(+), 8 deletions(-) Reviewed-by: Eric Blake > +++ b/block.c > @@ -2934,6 +2934,11 @@ int bdrv_has_zero_init(BlockDriverState *bs) > { > assert(bs->drv); > =20 > + /* If BS is a copy on write image, it is initialized to > + the contents of the base image, which may not be zeroes. */ > + if (bs->backing_hd) { > + return 0; Question (more for my understanding, not that you need to change code): must we blindly return 0 in the presence of a backing file, or is it possible to recursively query the backing_hd's zero_init status, allowing us to return 1 iff all files in the chain support zero_init. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --dMDdUBA3XIRhRMnVCp3X0dtmvRjqE4jgj 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.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJR6T1BAAoJEKeha0olJ0NqhDMH/2U/8lKE8YDvBOyEpq5cFMT7 x2EKckj6KIrlSFJpFIHQGUW77gIGh75coFKhDlrF//WcXaSBU8jx01HWyEuk2gK5 ignyy1BRaoUNk0nzo8AiYcYgUiQhjhO2RF2GikU0F/mBTZI2ff8LeTHuvw8aYlOS gwWnbM2TC6pBIPZRsSjjKx9uH5dcxTRmWr53Tv5rNM9eOwPnpzmjSbWZWDI7Z9qB s+LUBRKnigvz6WCZjMiYwQ7pyGz1tLN5IU/qVwwp523roUCCmSVaOv8SztRM6Y7u LC8UMx13NtDuxHf64Lq36wyQa+SY0aF1T12KPljFYPmVAAr0rb+JzHsrwYrcUrU= =aGtv -----END PGP SIGNATURE----- --dMDdUBA3XIRhRMnVCp3X0dtmvRjqE4jgj--