From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpWQO-0003bK-Hk for qemu-devel@nongnu.org; Thu, 29 Sep 2016 04:10:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpWQM-0008TB-PG for qemu-devel@nongnu.org; Thu, 29 Sep 2016 04:10:35 -0400 Date: Thu, 29 Sep 2016 16:10:22 +0800 From: Fam Zheng Message-ID: <20160929081022.GB2432@lemon> References: <1475046261-15679-1-git-send-email-famz@redhat.com> <20160929022147.GB6412@lemon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Max Reitz , Kevin Wolf , qemu-devel@nongnu.org, qemu-block@nongnu.org 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 driver > >> to actually make an effort to discard clusters as long they then read > >> 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 just > > complicates things a little. > > I don't think we actually have a use for a "MAY" unmap flag. Either we > 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). After reading rfc2119, now I agree that "SHOULD" is better. :) Fam