From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvqDA-0007aq-NW for qemu-devel@nongnu.org; Mon, 30 Jul 2012 09:40:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvqD8-0007ju-Dl for qemu-devel@nongnu.org; Mon, 30 Jul 2012 09:40:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57031) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvqD8-0007jj-69 for qemu-devel@nongnu.org; Mon, 30 Jul 2012 09:40:38 -0400 Message-ID: <50168ED0.7070502@redhat.com> Date: Mon, 30 Jul 2012 15:40:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1343127865-16608-1-git-send-email-pbonzini@redhat.com> <1343127865-16608-44-git-send-email-pbonzini@redhat.com> <5013EC8A.3000409@redhat.com> In-Reply-To: <5013EC8A.3000409@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 43/47] mirror: allow customizing the granularity List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, jcody@redhat.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com Il 28/07/2012 15:43, Eric Blake ha scritto: >> > + if (granularity < 512 || granularity > 1048576 * 64) { >> > + error_set(errp, QERR_INVALID_PARAMETER, device); >> > + return; >> > + } >> > + if (granularity & (granularity - 1)) { >> > + error_set(errp, QERR_INVALID_PARAMETER, device); >> > + return; > In the XBZLRE migration series, we decided to round the users input down > to a power of two instead of reject it. Should we do that here? I can certainly do that, but do you have a pointer to the discussion so that I can understand the rationale? > Also, > there is already an explicit QERR_PROPERY_VALUE_NOT_POWER_OF_2 that > might fit better here (depending on how the error cleanup series goes). It's not a property value though. Paolo