PCI save/restore changes


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2115 c046a42c-6fe2-441c-8c8c-71466251a162
diff --git a/hw/pci.c b/hw/pci.c
index 85531f7..75bd981 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -36,6 +36,8 @@
     PCIDevice *devices[256];
 };
 
+static void pci_update_mappings(PCIDevice *d);
+
 target_phys_addr_t pci_mem_base;
 static int pci_irq_index;
 static PCIBus *first_bus;
@@ -56,21 +58,20 @@
     return s->bus_num;
 }
 
-void generic_pci_save(QEMUFile* f, void *opaque)
+void pci_device_save(PCIDevice *s, QEMUFile *f)
 {
-    PCIDevice* s=(PCIDevice*)opaque;
-
+    qemu_put_be32(f, 1); /* PCI device version */
     qemu_put_buffer(f, s->config, 256);
 }
 
-int generic_pci_load(QEMUFile* f, void *opaque, int version_id)
+int pci_device_load(PCIDevice *s, QEMUFile *f)
 {
-    PCIDevice* s=(PCIDevice*)opaque;
-
+    uint32_t version_id;
+    version_id = qemu_get_be32(f);
     if (version_id != 1)
         return -EINVAL;
-
     qemu_get_buffer(f, s->config, 256);
+    pci_update_mappings(s);
     return 0;
 }