From patchwork Thu Dec 9 19:16:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 75017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 66667B70AA for ; Fri, 10 Dec 2010 11:37:53 +1100 (EST) Received: from localhost ([127.0.0.1]:35903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQqzd-0005zq-Lf for incoming@patchwork.ozlabs.org; Thu, 09 Dec 2010 19:37:49 -0500 Received: from [140.186.70.92] (port=48986 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQn73-0002Pf-9F for qemu-devel@nongnu.org; Thu, 09 Dec 2010 15:29:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQlyd-0005zr-Q6 for qemu-devel@nongnu.org; Thu, 09 Dec 2010 14:16:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PQlyd-0005w3-Ip for qemu-devel@nongnu.org; Thu, 09 Dec 2010 14:16:27 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oB9JGPW8011886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 9 Dec 2010 14:16:25 -0500 Received: from s20.home (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id oB9JGO3i030987; Thu, 9 Dec 2010 14:16:24 -0500 From: Alex Williamson To: qemu-devel@nongnu.org Date: Thu, 09 Dec 2010 12:16:24 -0700 Message-ID: <20101209191623.15450.19696.stgit@s20.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: alex.williamson@redhat.com, quintela@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH] rtl8139: IO memory is not part of vmstate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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, .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), VMSTATE_UINT32(currTxDesc, RTL8139State), VMSTATE_UINT32(currCPlusRxDesc, RTL8139State),