From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLTVs-0007mD-Sn for qemu-devel@nongnu.org; Fri, 08 Jul 2016 07:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLTVo-0002DY-QR for qemu-devel@nongnu.org; Fri, 08 Jul 2016 07:00:03 -0400 Received: from mx6-phx2.redhat.com ([209.132.183.39]:49744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLTVo-0002DR-HB for qemu-devel@nongnu.org; Fri, 08 Jul 2016 07:00:00 -0400 Date: Fri, 8 Jul 2016 06:59:59 -0400 (EDT) From: Paolo Bonzini Message-ID: <2119653923.5250404.1467975599457.JavaMail.zimbra@redhat.com> In-Reply-To: <20160708102110.GC10869@grmbl.mre> References: <1466433206-29241-1-git-send-email-pbonzini@redhat.com> <20160627072050.GD1389@grmbl.mre> <87oa6kdx2m.fsf@emacs.mitica> <20160708102110.GC10869@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] scsi: esp: fix migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: Juan Quintela , qemu-devel@nongnu.org, "Dr. David Alan Gilbert" > > > - 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