qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] (no subject)


From: Uri Lublin
Subject: [Qemu-devel] (no subject)
Date: Thu, 29 Jan 2009 21:54:49 +0200

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 <address@hidden>
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 <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]