From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7TLe-0007Pv-UP for qemu-devel@nongnu.org; Fri, 31 Aug 2012 11:41:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T7TLX-0002es-K2 for qemu-devel@nongnu.org; Fri, 31 Aug 2012 11:41:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T7TLX-0002ei-AF for qemu-devel@nongnu.org; Fri, 31 Aug 2012 11:41:23 -0400 Date: Fri, 31 Aug 2012 18:42:40 +0300 From: "Michael S. Tsirkin" Message-ID: <20120831154240.GC24891@redhat.com> References: <20120831084454.GB24072@redhat.com> <20120831144651.GC12212@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120831144651.GC12212@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] pcie: drop version_id field for live migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Baron Cc: yamahata@valinux.co.jp, alex.williamson@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, quintela@redhat.com On Fri, Aug 31, 2012 at 10:46:51AM -0400, Jason Baron wrote: > On Fri, Aug 31, 2012 at 11:44:54AM +0300, Michael S. Tsirkin wrote: > > On Thu, Aug 30, 2012 at 01:51:10PM -0400, Jason Baron wrote: > > > While testing q35 live migration, I found that the migration would abort with > > > the following error: "Unknown savevm section type 76". > > > > > > The error is due to this check failing in 'vmstate_load_state()': > > > > > > while(field->name) { > > > if ((field->field_exists && > > > field->field_exists(opaque, version_id)) || > > > (!field->field_exists && > > > field->version_id <= version_id)) { > > > > > > The VMSTATE_PCIE_DEVICE() currently has a 'version_id' set to 2. However, > > > 'version_id' in the above check is 1. And thus we fail to load the pcie device > > > field. Further the code returns to 'qemu_loadvm_state()' which produces the > > > error that I saw. > > > > > > I'm proposing to fix this by simply dropping the 'version_id' field from > > > VMSTATE_PCIE_DEVICE(). VMSTATE_PCI_DEVICE() defines no such field and further > > > the vmstate_pcie_device that VMSTATE_PCI_DEVICE() refers to is already > > > versioned. Thus, any versioning issues could be detected at the vmsd level. > > > > > > Taking a step back, I think that the 'field->version_id' should be compared > > > against a saved version number for the field not the 'version_id'. Futhermore, > > > once vmstate_load_state() is called recursively on another vmsd, the check of: > > > > > > if (version_id > vmsd->version_id) { > > > return -EINVAL; > > > } > > > > > > Will never fail since version_id is always equal to vmsd->version_id. So I'm > > > wondering why we aren't storing the vmsd version id of the source in the > > > migration stream? > > > > > > This patch also renames the 'name' field of vmstate_pcie_device from: > > > PCIDevice -> PCIEDevice to differentiate it from vmstate_pci_device. > > > > > > Signed-off-by: Jason Baron > > > > I have this queued to apply already - this is just a repost > > or did I miss something? > > > > just a repost...but now we have Juan's ack :) Right. It is preferable to tag reposts explicitly but no big deal.