diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-18 18:02:34 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-07-18 18:02:34 +0000 |
commit | 18fdb1c5c614ebdf9c3ea9ef0a548bd81cc1f981 (patch) | |
tree | e90fedcd280d57196fc2def055906546b46d28cc /hw/e1000.c | |
parent | 2cfc5f17d366b801484b36b548708fe0f3552737 (diff) |
Various NICs: Fix suspend/resume of multiple instances, by Jan Kiszka.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4892 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/e1000.c')
-rw-r--r-- | hw/e1000.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/hw/e1000.c b/hw/e1000.c index 47e20c14d1..1a14051629 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -76,7 +76,6 @@ typedef struct E1000State_st { PCIDevice dev; VLANClientState *vc; NICInfo *nd; - uint32_t instance; uint32_t mmio_base; int mmio_index; @@ -814,7 +813,6 @@ nic_save(QEMUFile *f, void *opaque) int i, j; pci_device_save(&s->dev, f); - qemu_put_be32s(f, &s->instance); qemu_put_be32s(f, &s->mmio_base); qemu_put_be32s(f, &s->rxbuf_size); qemu_put_be32s(f, &s->rxbuf_min_shift); @@ -859,7 +857,8 @@ nic_load(QEMUFile *f, void *opaque, int version_id) if ((ret = pci_device_load(&s->dev, f)) < 0) return ret; - qemu_get_be32s(f, &s->instance); + if (version_id == 1) + qemu_get_be32s(f, &i); /* once some unused instance id */ qemu_get_be32s(f, &s->mmio_base); qemu_get_be32s(f, &s->rxbuf_size); qemu_get_be32s(f, &s->rxbuf_min_shift); @@ -958,7 +957,6 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) { E1000State *d; uint8_t *pci_conf; - static int instance; uint16_t checksum = 0; char *info_str = "e1000"; int i; @@ -989,8 +987,6 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) pci_register_io_region((PCIDevice *)d, 1, IOPORT_SIZE, PCI_ADDRESS_SPACE_IO, ioport_map); - d->instance = instance++; - d->nd = nd; memmove(d->eeprom_data, e1000_eeprom_template, sizeof e1000_eeprom_template); @@ -1016,5 +1012,5 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) d->nd->macaddr[0], d->nd->macaddr[1], d->nd->macaddr[2], d->nd->macaddr[3], d->nd->macaddr[4], d->nd->macaddr[5]); - register_savevm(info_str, d->instance, 1, nic_save, nic_load, d); + register_savevm(info_str, -1, 2, nic_save, nic_load, d); } |