From 81dbb5e24585391df7ea2144ca6b9f0fc1956101 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 14 May 2008 16:58:20 +0100 Subject: [PATCH] pcnet: Allow save/restore of multiple NICs Change imported from xen-unstable. From the logs it's likely to have been this changeset: changeset: 14651:f06535a8ae9fd43e3d4147dbab335a8d4827d9f6 user: Tim Deegan date: Thu Mar 29 15:30:01 2007 +0000 files: tools/ioemu/hw/ne2000.c tools/ioemu/hw/pcnet.c tools/ioemu/hw/rtl8139.c description: [HVM] Save/restore: Allow save/restore of multiple NICs Signed-off-by: Tim Deegan --- hw/pcnet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/pcnet.c b/hw/pcnet.c index 0d0bb872..2d713532 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1896,6 +1896,7 @@ static int pcnet_load(QEMUFile *f, void *opaque, int version_id) static void pcnet_common_init(PCNetState *d, NICInfo *nd, const char *info_str) { + int instance; d->poll_timer = qemu_new_timer(vm_clock, pcnet_poll_timer, d); d->nd = nd; @@ -1916,7 +1917,8 @@ static void pcnet_common_init(PCNetState *d, NICInfo *nd, const char *info_str) d->vc = NULL; } pcnet_h_reset(d); - register_savevm("pcnet", 0, 2, pcnet_save, pcnet_load, d); + instance = pci_bus_num(d->dev.bus) << 8 | d->dev.devfn; + register_savevm("pcnet", instance, 2, pcnet_save, pcnet_load, d); } /* PCI interface */ -- 2.39.5