Received: from eggs.gnu.org ([2001:4830:134:3::10]:37961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHRNN-0005Cf-1M for qemu-devel@nongnu.org; Mon, 27 Jun 2016 03:54:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHRNJ-00015l-SA for qemu-devel@nongnu.org; Mon, 27 Jun 2016 03:54:37 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:36657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHRNJ-00015d-KF for qemu-devel@nongnu.org; Mon, 27 Jun 2016 03:54:33 -0400 Received: by mail-wm0-x233.google.com with SMTP id f126so88783233wma.1 for ; Mon, 27 Jun 2016 00:54:33 -0700 (PDT) Sender: Paolo Bonzini References: <1466433206-29241-1-git-send-email-pbonzini@redhat.com> <20160627072050.GD1389@grmbl.mre> From: Paolo Bonzini Message-ID: Date: Mon, 27 Jun 2016 09:54:24 +0200 MIME-Version: 1.0 In-Reply-To: <20160627072050.GD1389@grmbl.mre> Content-Type: text/plain; charset=windows-1252 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" On 27/06/2016 09:20, Amit Shah wrote: > On (Mon) 20 Jun 2016 [16:33:26], Paolo Bonzini wrote: >> Commit 926cde5 ("scsi: esp: make cmdbuf big enough for maximum CDB size", >> 2016-06-16) changed the size of a migrated field. Split it in two >> parts, and only migrate the second part in a new vmstate version. > > With this patch, the static checker fails in this way: > > Section "esp", Description "esp": expected field "cmdlen", got "cmdbuf"; skipping rest > Section "dc390", Description "esp": expected field "cmdlen", got "cmdbuf"; skipping rest > Section "am53c974", Description "esp": expected field "cmdlen", got "cmdbuf"; skipping rest > > Note it doesn't complain about the version numbers. That's because: > >> const VMStateDescription vmstate_esp = { >> .name ="esp", >> - .version_id = 3, >> + .version_id = 4, >> .minimum_version_id = 3, > > this suggests older versions can still be accepted for incoming > migration, which isn't true. Sure they can: - VMSTATE_BUFFER(cmdbuf, ESPState), + VMSTATE_PARTIAL_BUFFER(cmdbuf, ESPState, 16), + VMSTATE_BUFFER_START_MIDDLE_V(cmdbuf, ESPState, 16, 4), 2.6 is transmitting version 3 and a 16-byte buffer. 2.7 is transmitting version 4, a first 16-byte buffer, and a second 16-byte buffer that is skipped when receiving version 3. So it seems like a static checker limitation. Paolo