]> xenbits.xensource.com Git - qemu-xen-4.3-testing.git/commitdiff
merge from in xen-unstable tip (17318:b5fea3aeb04b): hw/rtl8139.c
authorIan Jackson <iwj@mariner.uk.xensource.com>
Wed, 7 May 2008 17:41:27 +0000 (18:41 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 12 May 2008 11:20:11 +0000 (12:20 +0100)
merge this changeset from xen-unstable:

changeset:   14651:f06535a8ae9fd43e3d4147dbab335a8d4827d9f6
user:        Tim Deegan <Tim.Deegan@xensource.com>
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 <Tim.Deegan@xenource.com>
hw/rtl8139.c

index a7ab7047af44cf9787e54a5cb53fe2bff5b76bf1..5d1a8fd23a1a54d99bd37eb7628087a95db7de08 100644 (file)
@@ -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);