From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55467) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaPtt-00058f-6w for qemu-devel@nongnu.org; Fri, 01 Jun 2012 07:20:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SaPti-0003mo-B7 for qemu-devel@nongnu.org; Fri, 01 Jun 2012 07:20:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaPti-0003jo-3H for qemu-devel@nongnu.org; Fri, 01 Jun 2012 07:20:02 -0400 From: Juan Quintela In-Reply-To: <1337691425-6022-9-git-send-email-owasserm@redhat.com> (Orit Wasserman's message of "Tue, 22 May 2012 15:57:04 +0300") References: <1337691425-6022-1-git-send-email-owasserm@redhat.com> <1337691425-6022-9-git-send-email-owasserm@redhat.com> Date: Fri, 01 Jun 2012 13:19:01 +0200 Message-ID: <87bol38el6.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v11 8/9] Add set_cachesize command Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Orit Wasserman Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, Benoit Hudzia , mdroth@linux.vnet.ibm.com, blauwirbel@gmail.com, Petter Svard , chegu_vinod@hp.com, avi@redhat.com, Aidan Shribman , pbonzini@redhat.com, eblake@redhat.com Orit Wasserman wrote: > Change XBZRLE cache size in bytes (the size should be a power of 2). > If XBZRLE cache size is too small there will be many cache miss. > > Signed-off-by: Benoit Hudzia > Signed-off-by: Petter Svard > Signed-off-by: Aidan Shribman > Signed-off-by: Orit Wasserman > +void qmp_migrate_set_cachesize(int64_t value, Error **errp) > +{ > + MigrationState *s = migrate_get_current(); > + > + /* Check for truncation */ > + if (value != (size_t)value) { > + error_set(errp, QERR_INVALID_PARAMETER_VALUE, "cache size", > + "exceeding address space"); > + return; > + } > + > + value = MIN(UINT64_MAX, value); This looks fishy to say the least. value is signed. Is there any way that UINT64_MAX is going to be smaller than value?