From: Ian Jackson Date: Wed, 7 May 2008 17:41:27 +0000 (+0100) Subject: merge from in xen-unstable tip (17318:b5fea3aeb04b): hw/rtl8139.c X-Git-Tag: xen-3.3.0-rc1~200 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9029cf72fa9acee0f2422d8f43131d1bc3223683;p=qemu-xen-unstable.git merge from in xen-unstable tip (17318:b5fea3aeb04b): hw/rtl8139.c merge this changeset from xen-unstable: 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 --- diff --git a/hw/rtl8139.c b/hw/rtl8139.c index a7ab7047af..5d1a8fd23a 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -3405,6 +3405,7 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn) PCIRTL8139State *d; RTL8139State *s; uint8_t *pci_conf; + int instance; d = (PCIRTL8139State *)pci_register_device(bus, "RTL8139", sizeof(PCIRTL8139State), @@ -3454,8 +3455,8 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn) s->cplus_txbuffer_len = 0; s->cplus_txbuffer_offset = 0; - /* XXX: instance number ? */ - register_savevm("rtl8139", 0, 3, rtl8139_save, rtl8139_load, s); + instance = pci_bus_num(bus) << 8 | s->pci_dev->devfn; + register_savevm("rtl8139", instance, 3, rtl8139_save, rtl8139_load, s); #if RTL8139_ONBOARD_TIMER s->timer = qemu_new_timer(vm_clock, rtl8139_timer, s);