qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] scsi: esp: fix migration


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] scsi: esp: fix migration
Date: Fri, 8 Jul 2016 06:59:59 -0400 (EDT)

> > > -        VMSTATE_BUFFER(cmdbuf, ESPState),
> > > +        VMSTATE_PARTIAL_BUFFER(cmdbuf, ESPState, 16),
> > > +        VMSTATE_BUFFER_START_MIDDLE_V(cmdbuf, ESPState, 16, 4),
> > 
> > Amit, would it help the checker if we do something like:
> > 
> > -        VMSTATE_BUFFER(cmdbuf, ESPState),
> > +        VMSTATE_PARTIAL_BUFFER_TEST(cmdbuf, ESPState, 16, v_is_3),
> > +        VMSTATE_BUFFER_TEST(cmdbuf, ESPState, from_4),
> > 
> > Yes, VMSTATE_PARTIAL_BUFFER_TEST don't exist, but it is trivial to
> > define.
> 
> Yea, I think it'll help.  But I'm also thinking what else we do in
> code that we can offload to vmstate.  Or if there's something that we
> just don't express in vmstate yet.

The checker has to compare this (vmstate version_id = 3):

              {
                "field": "cmdbuf",
                "version_id": 0,
                "field_exists": false,
                "size": 16
              },

to this (vmstate version_id = 4):

              {
                "field": "cmdbuf",
                "version_id": 0,
                "field_exists": false,
                "size": 16
              },
              {
                "field": "cmdbuf",
                "version_id": 4,
                "field_exists": false,
                "size": 16
              },

If the static checker finds a destination field whose version_id is
larger than the source vmstate's version_id, you have to print a
different warning and advance the destination only.

Thanks,

Paolo



reply via email to

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