Received: from eggs.gnu.org ([2001:4830:134:3::10]:42517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqK2K-0008SA-Pw for qemu-devel@nongnu.org; Sat, 01 Oct 2016 09:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqK2J-0005lg-SI for qemu-devel@nongnu.org; Sat, 01 Oct 2016 09:09:04 -0400 References: <1475046261-15679-1-git-send-email-famz@redhat.com> <20160929022147.GB6412@lemon> <20160929081022.GB2432@lemon> From: Max Reitz Message-ID: Date: Sat, 1 Oct 2016 15:08:51 +0200 MIME-Version: 1.0 In-Reply-To: <20160929081022.GB2432@lemon> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E5mc6LlCWpKABnOnBwroha4fDKQkXOoOw" Subject: Re: [Qemu-devel] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E5mc6LlCWpKABnOnBwroha4fDKQkXOoOw From: Max Reitz To: Fam Zheng , Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org Message-ID: Subject: Re: [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP References: <1475046261-15679-1-git-send-email-famz@redhat.com> <20160929022147.GB6412@lemon> <20160929081022.GB2432@lemon> In-Reply-To: <20160929081022.GB2432@lemon> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 29.09.2016 10:10, Fam Zheng wrote: > On Thu, 09/29 09:58, Paolo Bonzini wrote: >> >> >> On 29/09/2016 04:21, Fam Zheng wrote: >>> On Wed, 09/28 18:11, Max Reitz wrote: >>>> Note that BDRV_REQ_MAY_UNMAP does not mean "Yes, please discard" but= >>>> just "You may discard if it's easier for you". But it's actually not= >>>> easier for us, so I don't see why we're doing it. >>>> >>>> As far as I can guess you actually want some way to tell a block dri= ver >>>> to actually make an effort to discard clusters as long they then rea= d >>>> back as zero (which is why you cannot simply use bdrv_pdiscard()). >>>> However, I think this would require a new flag called >>>> BDRV_REQ_SHOULD_UNMAP (which should imply BDRV_REQ_MAY_UNMAP). >>> >>> This flag doesn't make sense to me, if the protocol doesn't know how = to unmap, >>> it can ignore BDRV_REQ_MAY_UNMAP, but not BDRV_REQ_SHOULD_UNMAP. It j= ust >>> complicates things a little. >> >> I don't think we actually have a use for a "MAY" unmap flag. Either w= e >> keep the not-so-perfect name or we replace MAY_UNMAP with "should" or >> "want" or "would_like" unmap... But Fam's patch does do what was >> intended for the flag (which is the equivalent of the UNMAP bit in the= >> SCSI WRITE SAME command). >=20 > After reading rfc2119, now I agree that "SHOULD" is better. :) That's OK with me, then. Max --E5mc6LlCWpKABnOnBwroha4fDKQkXOoOw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEvBAEBCAAZBQJX77VjEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRD0B9sAYdXPQJdW B/4+tw+u0+teroslFTmmVRbj12nJnqvpl1eXKwiTlHpQqZRr2XHWI1DCEifRRs+7 5sc29aygi60iNk3AdxhOOi8MayTkBLYmG8m8ShONE79LELUJ3jvPUnIJ5bA8iwTY pyfyL4etlF0xTViYJn0RCFE5EBUd3uoSico/S0Wfi1qe5zXlWvBkbStJP885R6zT oiFk5cYYOxknzDsa72b18nmWa+IgwEN4dAlbgFZBmbsL/3M8Od9hQlflknL+iiqa Oh0YX10hUjQOX3QdfrZQYyVHkTzd2GyzGzjqJ92FPsb0TLUsGauiCYpk6eUF5omk 03VS9X219Fwv3ahxwERgxOhN =0bh+ -----END PGP SIGNATURE----- --E5mc6LlCWpKABnOnBwroha4fDKQkXOoOw--