From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIsR0-0007eH-Oa for qemu-devel@nongnu.org; Mon, 01 Oct 2012 22:42:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIsQz-0002h1-98 for qemu-devel@nongnu.org; Mon, 01 Oct 2012 22:42:10 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:53086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIsQy-0002Zx-Nt for qemu-devel@nongnu.org; Mon, 01 Oct 2012 22:42:09 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 2 Oct 2012 12:40:32 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q922W9AL36700374 for ; Tue, 2 Oct 2012 12:32:12 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q922fn7H011698 for ; Tue, 2 Oct 2012 12:41:49 +1000 Date: Tue, 2 Oct 2012 12:14:20 +1000 From: David Gibson Message-ID: <20121002021420.GE29302@truffula.fritz.box> References: <1348629678-13182-1-git-send-email-david@gibson.dropbear.id.au> <1348629678-13182-2-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 1/6] savevm: Add VMSTATE_UINT64_EQUAL helpers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org On Sat, Sep 29, 2012 at 11:36:35AM +0000, Blue Swirl wrote: > On Wed, Sep 26, 2012 at 3:21 AM, David Gibson > wrote: > > The savevm code already includes a number of *_EQUAL helpers which act as > > sanity checks verifying that the configuration of the saved state matches > > that of the machine we're loading into to work. Variants already exist > > for 8 bit 16 bit and 32 bit integers, but not 64 bit integers. This patch > > fills that hole, adding a UINT64 version. > > > > Signed-off-by: David Gibson > > --- > > savevm.c | 20 ++++++++++++++++++++ > > vmstate.h | 7 +++++++ > > 2 files changed, 27 insertions(+) > > > > diff --git a/savevm.c b/savevm.c > > index c7fe283..f38e16e 100644 > > --- a/savevm.c > > +++ b/savevm.c > > @@ -1043,6 +1043,26 @@ const VMStateInfo vmstate_info_uint64 = { > > .put = put_uint64, > > }; > > > > +/* 64 bit unsigned int. See that the received value is the same than the one > > + in the field */ > > + > > +static int get_uint64_equal(QEMUFile *f, void *pv, size_t size) > > +{ > > + uint64_t *v = pv; > > + uint64_t v2; > > + qemu_get_be64s(f, &v2); > > + > > + if (*v == v2) > > Braces. Oops, fixed for the next version. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson