From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bosSL-0003rC-Bv for qemu-devel@nongnu.org; Tue, 27 Sep 2016 09:30:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bosSJ-0000Y7-9k for qemu-devel@nongnu.org; Tue, 27 Sep 2016 09:29:56 -0400 References: <1474974892-5031-1-git-send-email-famz@redhat.com> From: Eric Blake Message-ID: <783bc7c4-08f0-f6bc-22ab-7cf7b65c9fca@redhat.com> Date: Tue, 27 Sep 2016 08:29:47 -0500 MIME-Version: 1.0 In-Reply-To: <1474974892-5031-1-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="u6pD42CaV3RqDXE9EuegsVwWcnBuCRP0V" Subject: Re: [Qemu-devel] [PATCH v3] block: Turn on "unmap" in active commit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , qemu-block@nongnu.org, Max Reitz This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --u6pD42CaV3RqDXE9EuegsVwWcnBuCRP0V From: Eric Blake To: Fam Zheng , qemu-devel@nongnu.org Cc: Kevin Wolf , Jeff Cody , qemu-block@nongnu.org, Max Reitz Message-ID: <783bc7c4-08f0-f6bc-22ab-7cf7b65c9fca@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3] block: Turn on "unmap" in active commit References: <1474974892-5031-1-git-send-email-famz@redhat.com> In-Reply-To: <1474974892-5031-1-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/27/2016 06:14 AM, Fam Zheng wrote: > We already specified BDRV_O_UNMAP when opening images in 'qemu-img > commit', but didn't turn on the "unmap" in the active commit job. This > patch fixes that so that zeroed clusters in top image can be discarded > which is desired in the virt-sparsify use case, where a temporary > overlay is created and fstrim'ed before commiting back, to free space i= n > the original image. >=20 > This also enables it for block-commit. >=20 > Signed-off-by: Fam Zheng > --- > v3: Change the right parameter. Doesn't affect this patch, but it may be worth using the 'boxed':true notation in the .json file to make it more compact to pass job information around via a struct rather than a large mess of parameters where you are likely to get the wrong one. > v2: Add "unmap" to block-commit as well. [Kevin] > --- > block/mirror.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/block/mirror.c b/block/mirror.c > index f9d1fec..8847ec5 100644 > --- a/block/mirror.c > +++ b/block/mirror.c > @@ -1042,7 +1042,7 @@ void commit_active_start(const char *job_id, Bloc= kDriverState *bs, > =20 > mirror_start_job(job_id, bs, base, NULL, speed, 0, 0, > MIRROR_LEAVE_BACKING_CHAIN, > - on_error, on_error, false, cb, opaque, &local_err= , > + on_error, on_error, true, cb, opaque, &local_err,= > &commit_active_job_driver, false, base, auto_comp= lete); --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --u6pD42CaV3RqDXE9EuegsVwWcnBuCRP0V Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJX6nRLAAoJEKeha0olJ0NqGZoIAJ1nMOCJHiyAij1u0vlKS1ao 3GdQlg43YwuWtziiKSKyIfm69pSEB+2sfHmOmVq0l0NcIGzsc4ytJV8/wi+2VQyW W9hUEm/0+ZZILbr5DwkvBX+2ha9XXVSiUgq3eYZTVAS6G3Tf3uTi8tvWl3goysrK zG8eEWdX20xR50+neQHJdrzg7XjTq9tdZBY7mtOEpmoL39cpV+1hieEn37LzITri bKFD88BbD2uCcMQIxw47eLiiatWqvCeWWfVPPATwQlTsI2iTjvKX1OstXoLzpjHT dJrPlqrY4YHs00JAoCH91k5MStR6wx9uvvQVDgP5y31DR3V536p5tSeWmhpsTkY= =rttV -----END PGP SIGNATURE----- --u6pD42CaV3RqDXE9EuegsVwWcnBuCRP0V--