]> xenbits.xensource.com Git - qemu-xen-4.1-testing.git/commitdiff
pcnet: Allow save/restore of multiple NICs
authorIan Jackson <iwj@mariner.uk.xensource.com>
Wed, 14 May 2008 15:58:20 +0000 (16:58 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 14 May 2008 15:58:20 +0000 (16:58 +0100)
Change imported from xen-unstable.  From the logs it's likely to have
been this changeset:

    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/pcnet.c

index 0d0bb872c7fabf8dfad8b44e5196168a0faee7d6..2d71353284dc6bd8e1de218bdcad07ba9b55406d 100644 (file)
@@ -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 */