From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bGKG9-0004Nf-IF for qemu-devel@nongnu.org; Fri, 24 Jun 2016 02:06:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bGKG7-0000Fy-I7 for qemu-devel@nongnu.org; Fri, 24 Jun 2016 02:06:32 -0400 Date: Fri, 24 Jun 2016 14:06:19 +0800 From: Fam Zheng Message-ID: <20160624060619.GB12330@ad.usersys.redhat.com> References: <1466721446-27737-1-git-send-email-eblake@redhat.com> <1466721446-27737-16-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1466721446-27737-16-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 15/22] block: Switch transfer 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, qemu-block@nongnu.org, kwolf@redhat.com, stefanha@redhat.com, Max Reitz , Ronnie Sahlberg , Paolo Bonzini , Peter Lieven , "Michael S. Tsirkin" On Thu, 06/23 16:37, Eric Blake wrote: > Sector-based limits are awkward to think about; in our on-going > quest to move to byte-based interfaces, convert max_transfer_length > and opt_transfer_length. Rename them (dropping the _length suffix) > so that the compiler will help us catch the change in semantics > across any rebased code, and improve the documentation. Use unsigned > values, so that we don't have to worry about negative values and > so that bit-twiddling is easier; however, we are still constrained > by 2^31 of signed int in most APIs. > > When a value comes from an external source (iscsi and raw-posix), > sanitize the results to ensure that opt_transfer is a power of 2. > > Signed-off-by: Eric Blake Reviewed-by: Fam Zheng