From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58028) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAGnq-0003jv-79 for qemu-devel@nongnu.org; Tue, 07 Jun 2016 09:12:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAGnk-0006X8-6u for qemu-devel@nongnu.org; Tue, 07 Jun 2016 09:12:18 -0400 Date: Tue, 7 Jun 2016 15:12:02 +0200 From: Kevin Wolf Message-ID: <20160607131202.GI4684@noname.str.redhat.com> References: <1464973388-15821-1-git-send-email-eblake@redhat.com> <1464973388-15821-5-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464973388-15821-5-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH 4/5] block: Switch discard length bounds to byte-based List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, mreitz@redhat.com, qemu-block@nongnu.org, Stefan Hajnoczi , Fam Zheng , Ronnie Sahlberg , Paolo Bonzini , Peter Lieven Am 03.06.2016 um 19:03 hat Eric Blake geschrieben: > Sector-based limits are awkward to think about; in our on-going > quest to move to byte-based interfaces, convert max_discard and > discard_alignment. Rename them, using 'pdiscard' as an aid to > track which remaining discard interfaces need conversion, and so > that the compiler will help us catch the change in semantics > across any rebased code. In iscsi.c, sector_limits_lun2qemu() > is no longer needed; and the BlockLimits type is now completely > byte-based. > > Signed-off-by: Eric Blake > diff --git a/block/nbd.c b/block/nbd.c > index 2ce7b4d..a3de9bc 100644 > --- a/block/nbd.c > +++ b/block/nbd.c > @@ -362,7 +362,7 @@ static int nbd_co_flush(BlockDriverState *bs) > > static void nbd_refresh_limits(BlockDriverState *bs, Error **errp) > { > - bs->bl.max_discard = UINT32_MAX >> BDRV_SECTOR_BITS; > + bs->bl.max_pdiscard = INT32_MAX; > bs->bl.max_transfer = NBD_MAX_BUFFER_SIZE; > } Another non-mechanical change that might deserve its own patch (or probably one NBD patch that changes both values). Kevin