diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-17 10:46:34 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2006-08-17 10:46:34 +0000 |
commit | 1941d19c657a8084603e88d7860786baa40c0e80 (patch) | |
tree | e40f3b80ebfe96c335e594678218ae8b0eb726bc /hw/rtl8139.c | |
parent | 89b6b508929d63b2a3dda18692fcb724afb43336 (diff) |
PCI save/restore changes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2115 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/rtl8139.c')
-rw-r--r-- | hw/rtl8139.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 9c613a8f93..db6353a7e5 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -3122,6 +3122,8 @@ static void rtl8139_save(QEMUFile* f,void* opaque) RTL8139State* s=(RTL8139State*)opaque; int i; + pci_device_save(s->pci_dev, f); + qemu_put_buffer(f, s->phys, 6); qemu_put_buffer(f, s->mult, 8); @@ -3203,12 +3205,18 @@ static void rtl8139_save(QEMUFile* f,void* opaque) static int rtl8139_load(QEMUFile* f,void* opaque,int version_id) { RTL8139State* s=(RTL8139State*)opaque; - int i; + int i, ret; /* just 2 versions for now */ - if (version_id > 2) + if (version_id > 3) return -EINVAL; + if (version_id >= 3) { + ret = pci_device_load(s->pci_dev, f); + if (ret < 0) + return ret; + } + /* saved since version 1 */ qemu_get_buffer(f, s->phys, 6); qemu_get_buffer(f, s->mult, 8); @@ -3457,9 +3465,7 @@ void pci_rtl8139_init(PCIBus *bus, NICInfo *nd) s->cplus_txbuffer_offset = 0; /* XXX: instance number ? */ - register_savevm("rtl8139", 0, 2, rtl8139_save, rtl8139_load, s); - register_savevm("rtl8139_pci", 0, 1, generic_pci_save, generic_pci_load, - &d->dev); + register_savevm("rtl8139", 0, 3, rtl8139_save, rtl8139_load, s); #if RTL8139_ONBOARD_TIMER s->timer = qemu_new_timer(vm_clock, rtl8139_timer, s); |