From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=57711 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQokn-0002ON-4a for qemu-devel@nongnu.org; Thu, 09 Dec 2010 17:14:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQokl-0007Th-GB for qemu-devel@nongnu.org; Thu, 09 Dec 2010 17:14:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQokl-0007TL-8o for qemu-devel@nongnu.org; Thu, 09 Dec 2010 17:14:19 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9MEIet018436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Dec 2010 17:14:18 -0500 From: Alex Williamson In-Reply-To: References: <20101209191623.15450.19696.stgit@s20.home> Content-Type: text/plain; charset="UTF-8" Date: Thu, 09 Dec 2010 15:14:17 -0700 Message-ID: <1291932857.2926.20.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] rtl8139: IO memory is not part of vmstate List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: quintela@redhat.com Cc: qemu-devel@nongnu.org, mst@redhat.com On Thu, 2010-12-09 at 22:49 +0100, Juan Quintela wrote: > Alex Williamson wrote: > > The cpu_register_io_memory() value is unique to the VM instance and > > should not be restored after migration/save. Doing so means we > > could be pointing at arbitrary device's io regions after migration/restore. > > > > In this case, if we start a VM with a single rtl8139, hot add a 2nd, > > migrate the VM, then hot remove the added NIC, the 1st NIC stops > > working and the VM segfaults on reboot. > > > > Signed-off-by: Alex Williamson > > --- > > > > hw/rtl8139.c | 4 ++-- > > 1 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/hw/rtl8139.c b/hw/rtl8139.c > > index d92981d..9c5fc84 100644 > > --- a/hw/rtl8139.c > > +++ b/hw/rtl8139.c > > @@ -3186,7 +3186,7 @@ static void rtl8139_pre_save(void *opaque) > > > > static const VMStateDescription vmstate_rtl8139 = { > > .name = "rtl8139", > > - .version_id = 4, > > + .version_id = 5, > > No need to change version, format is still the same. > > > .minimum_version_id = 3, > > .minimum_version_id_old = 3, > > .post_load = rtl8139_post_load, > > @@ -3234,7 +3234,7 @@ static const VMStateDescription vmstate_rtl8139 = { > > > > VMSTATE_UNUSED(4), > > VMSTATE_MACADDR(conf.macaddr, RTL8139State), > > - VMSTATE_INT32(rtl8139_mmio_io_addr, RTL8139State), > > + VMSTATE_UNUSED(4), > > If we migrate from an old guest: we just ignore the value. > If we migrate to one old guest, we send garbage, but as you told that we > were already sending garbage, it looks ok, no? NAK, if we don't bump the version, we don't know if we're migration to/from a version 4 that includes the io address or not. We have no good way to debug different binaries on different systems. It seems to work today if we don't involve hotplug, so I think we have to maintain version 4 as including the io address, and let version 5 drop it. I tested old to new migrations, and as you expect, it does work. Alex