qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/6] savevm: Add VMSTATE_UINT64_EQUAL helpers


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 1/6] savevm: Add VMSTATE_UINT64_EQUAL helpers
Date: Tue, 2 Oct 2012 12:14:20 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

On Sat, Sep 29, 2012 at 11:36:35AM +0000, Blue Swirl wrote:
> On Wed, Sep 26, 2012 at 3:21 AM, David Gibson
> <address@hidden> 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 <address@hidden>
> > ---
> >  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]