Index: /trunk/src/VBox/Devices/Bus/DevPCI.cpp
===================================================================
--- /trunk/src/VBox/Devices/Bus/DevPCI.cpp	(revision 24144)
+++ /trunk/src/VBox/Devices/Bus/DevPCI.cpp	(revision 24145)
@@ -1326,48 +1326,4 @@
 
 /**
- * Disables all PCI devices prior to state loading.
- *
- * @returns VINF_SUCCESS.
- * @param   pBus                The PCI bus instance.
- */
-static int pciR3CommonLoadPrep(PPCIBUS pBus)
-{
-    /*
-     * Iterate thru all the devices and write 0 to the COMMAND register.
-     * The register value is restored afterwards so we can do proper
-     * LogRels in pciR3CommonRestoreConfig.
-     */
-    for (uint32_t i = 0; i < RT_ELEMENTS(pBus->devices); i++)
-    {
-        PPCIDEVICE pDev = pBus->devices[i];
-        if (pDev)
-        {
-            uint16_t u16 = PCIDevGetCommand(pDev);
-            pDev->Int.s.pfnConfigWrite(pDev, VBOX_PCI_COMMAND, 0, 2);
-            PCIDevSetCommand(pDev, u16);
-            Assert(PCIDevGetCommand(pDev) == u16);
-        }
-    }
-    return VINF_SUCCESS;
-}
-
-
-/**
- * Prepares a state load.
- *
- * This will disable all the device so that the I/O regions gets unmapped.
- *
- * @returns VINF_SUCCESS
- * @param   pDevIns             The device instance.
- * @param   pSSMHandle          The saved state handle.
- */
-static DECLCALLBACK(int) pciR3LoadPrep(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
-{
-    PPCIGLOBALS pThis = PDMINS_2_DATA(pDevIns, PPCIGLOBALS);
-    return pciR3CommonLoadPrep(&pThis->PciBus);
-}
-
-
-/**
  * Common routine for restoring the config registers of a PCI device.
  *
@@ -1513,5 +1469,5 @@
                 }
                 if (off == VBOX_PCI_COMMAND)
-                    PCIDevSetCommand(pDev, 0); /* For remapping, see pciR3CommonLoadPrep. */
+                    PCIDevSetCommand(pDev, 0); /* For remapping, see pciR3CommonLoadExec. */
                 pDev->Int.s.pfnConfigWrite(pDev, off, u32Src, cb);
             }
@@ -1551,4 +1507,24 @@
 
     Assert(uPass == SSM_PASS_FINAL); NOREF(uPass);
+
+    /*
+     * Iterate thru all the devices and write 0 to the COMMAND register so
+     * that all the memory is unmapped before we start restoring the saved
+     * mapping locations.
+     *
+     * The register value is restored afterwards so we can do proper
+     * LogRels in pciR3CommonRestoreConfig.
+     */
+    for (uint32_t i = 0; i < RT_ELEMENTS(pBus->devices); i++)
+    {
+        PPCIDEVICE pDev = pBus->devices[i];
+        if (pDev)
+        {
+            uint16_t u16 = PCIDevGetCommand(pDev);
+            pDev->Int.s.pfnConfigWrite(pDev, VBOX_PCI_COMMAND, 0, 2);
+            PCIDevSetCommand(pDev, u16);
+            Assert(PCIDevGetCommand(pDev) == u16);
+        }
+    }
 
     /*
@@ -2152,5 +2128,5 @@
                                 NULL, NULL, NULL,
                                 NULL, pciR3SaveExec, NULL,
-                                pciR3LoadPrep, pciR3LoadExec, NULL);
+                                NULL, pciR3LoadExec, NULL);
     if (RT_FAILURE(rc))
         return rc;
@@ -2328,20 +2304,4 @@
 
 /**
- * Prepares a state load.
- *
- * This will disable all the device so that the I/O regions gets unmapped.
- *
- * @returns VINF_SUCCESS
- * @param   pDevIns             The device instance.
- * @param   pSSMHandle          The saved state handle.
- */
-static DECLCALLBACK(int) pcibridgeR3LoadPrep(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle)
-{
-    PPCIBUS pThis = PDMINS_2_DATA(pDevIns, PPCIBUS);
-    return pciR3CommonLoadPrep(pThis);
-}
-
-
-/**
  * Loads a saved PCI bridge device state.
  *
@@ -2541,5 +2501,5 @@
                                 NULL, NULL, NULL,
                                 NULL, pcibridgeR3SaveExec, NULL,
-                                pcibridgeR3LoadPrep, pcibridgeR3LoadExec, NULL);
+                                NULL, pcibridgeR3LoadExec, NULL);
     if (RT_FAILURE(rc))
         return rc;
