From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LScyY-0001LC-5V for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LScyU-0001GZ-TW for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:57 -0500 Received: from [199.232.76.173] (port=39360 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LScyU-0001G6-Nk for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:54 -0500 Received: from mx2.redhat.com ([66.187.237.31]:50636) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LScyU-0007lj-7s for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:54 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0TJsq0n013321 for ; Thu, 29 Jan 2009 14:54:52 -0500 From: Uri Lublin Date: Thu, 29 Jan 2009 21:54:49 +0200 Message-Id: <1233258889-6878-1-git-send-email-uril@redhat.com> Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hello@redhat.com, Uri Lublin The following patch fixes saving/loading/migrating a VM with multiple e1000 NICs. It turns out many devices use -1 as instance (for register_savevm), which is wrong in cases where there can exist multiple such devices within a single VM. -------------------------------------------- >>From e89f237fbfbeed937ccf63a4dcd20955c41f4081 Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Thu, 29 Jan 2009 21:37:53 +0200 Subject: [PATCH] e1000: fix register_savevm for multiple nics Solution is similar to other devices (a static variable). Signed-off-by: Uri Lublin --- hw/e1000.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index a38ab73..f62743d 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1040,8 +1040,8 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) E1000State *d; uint8_t *pci_conf; uint16_t checksum = 0; - static const char info_str[] = "e1000"; int i; + static int nnics=0; d = (E1000State *)pci_register_device(bus, "e1000", sizeof(E1000State), devfn, NULL, NULL); @@ -1092,5 +1092,5 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) qemu_format_nic_info_str(d->vc, d->nd->macaddr); - register_savevm(info_str, -1, 2, nic_save, nic_load, d); + register_savevm("e1000", nnics++, 2, nic_save, nic_load, d); } -- 1.6.0.6