From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWje-0005od-1d for qemu-devel@nongnu.org; Wed, 30 Jul 2014 12:28:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCWjZ-0002oe-3i for qemu-devel@nongnu.org; Wed, 30 Jul 2014 12:28:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCWjY-0002oU-RH for qemu-devel@nongnu.org; Wed, 30 Jul 2014 12:28:09 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6UGS821008432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 30 Jul 2014 12:28:08 -0400 Message-ID: <53D91D17.5080103@redhat.com> Date: Wed, 30 Jul 2014 10:28:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <1406402531-9278-1-git-send-email-mreitz@redhat.com> <1406402531-9278-5-git-send-email-mreitz@redhat.com> In-Reply-To: <1406402531-9278-5-git-send-email-mreitz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="KN56I9ef7ECbUo5DHLUEAMMRgBNFJoqM4" Subject: Re: [Qemu-devel] [PATCH alt 4/7] block/qcow2: Implement status CB for amend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Hajnoczi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --KN56I9ef7ECbUo5DHLUEAMMRgBNFJoqM4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 07/26/2014 01:22 PM, Max Reitz wrote: > The only really time-consuming operation potentially performed by > qcow2_amend_options() is zero cluster expansion when downgrading qcow2 > images from compat=3D1.1 to compat=3D0.10, so report status of that > operation and that operation only through the status CB. >=20 > For this, approximate the progress as the number of L1 entries visited > during the operation. >=20 > Signed-off-by: Max Reitz > --- > block/qcow2-cluster.c | 36 ++++++++++++++++++++++++++++++++---- > block/qcow2.c | 9 ++++----- > block/qcow2.h | 3 ++- > 3 files changed, 38 insertions(+), 10 deletions(-) Seems like a reasonable approximation. The progress may appear to change non-linearly (slower when a sequence of L1 entries visit all-zero data, faster when the entries visit normal data), but we never promised linear growth. >=20 > diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c > index 4208dc0..f8bec6f 100644 > --- a/block/qcow2-cluster.c > +++ b/block/qcow2-cluster.c > @@ -1548,10 +1548,17 @@ fail: > * zero expansion (i.e., has been filled with zeroes and is referenced= from an > * L2 table). nb_clusters contains the total cluster count of the imag= e file, > * i.e., the number of bits in expanded_clusters. > + * > + * l1_entries and *visited_l1_entries are ued to keep track of progres= s for s/ued/used/ Definitely looks simpler than your other approach. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --KN56I9ef7ECbUo5DHLUEAMMRgBNFJoqM4 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 iQEcBAEBCAAGBQJT2R0XAAoJEKeha0olJ0Nqq4oH/238mOQC8xsX8R4t8MBdVoCF qBkgC7OoTdGZBtwfWVtB5z1IBzuSfDiZiuqt3B/2M3atfMKZj1bnOtXbZMf4t7Dr QuwbztyDPRWS37CIfHwcUvl0Qn0ubpPaueZzRZRoDpoVyGRNburkX/GXC4CytdMi Mjx6ZKka4Wn0PXyVoHsbc8NsR3/vCcJ5N37qX4pPRnn/ocGMBhOSAl3jIkOdbWnB SLjIfczOCXEwFEAE2UmteUX6HlSyG1ocgjX77LX2oat6ejDeLFaVdmfiSqZFVq6C bQ0ISE74wY4t+ZNad+hrC7PxISuv5iCs7+935Hyyla+fEIixKPD5HkU9hA0bjGE= =fb3V -----END PGP SIGNATURE----- --KN56I9ef7ECbUo5DHLUEAMMRgBNFJoqM4--