From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc8lL-0003jh-EM for qemu-devel@nongnu.org; Wed, 06 Jun 2012 01:26:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc8lJ-0003Rn-9w for qemu-devel@nongnu.org; Wed, 06 Jun 2012 01:26:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12848) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc8lJ-0003RE-1o for qemu-devel@nongnu.org; Wed, 06 Jun 2012 01:26:29 -0400 Message-ID: <4FCEBCF3.9020509@redhat.com> Date: Wed, 06 Jun 2012 05:14:11 +0300 From: Orit Wasserman MIME-Version: 1.0 References: <1337691425-6022-1-git-send-email-owasserm@redhat.com> <1337691425-6022-9-git-send-email-owasserm@redhat.com> <87bol38el6.fsf@elfo.elfo> In-Reply-To: <87bol38el6.fsf@elfo.elfo> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v11 8/9] Add set_cachesize command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com 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 On 06/01/2012 02:19 PM, Juan Quintela wrote: > 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? > You are right. I will remove it. Orit