if (qemuProcessSetLinkStates(driver, vm, asyncJob) < 0)
goto cleanup;
- VIR_DEBUG("Fetching list of active devices");
- if (qemuDomainUpdateDeviceList(driver, vm, asyncJob) < 0)
- goto cleanup;
-
- VIR_DEBUG("Updating info of memory devices");
- if (qemuDomainUpdateMemoryDeviceInfo(driver, vm, asyncJob) < 0)
- goto cleanup;
-
VIR_DEBUG("Setting initial memory amount");
if (qemuProcessSetupBalloon(driver, vm, asyncJob) < 0)
goto cleanup;
qemuProcessRefreshBalloonState(driver, vm, asyncJob) < 0)
goto cleanup;
- VIR_DEBUG("Detecting actual memory size for video device");
- if (qemuProcessUpdateVideoRamSize(driver, vm, asyncJob) < 0)
- goto cleanup;
-
- VIR_DEBUG("Updating disk data");
- if (qemuProcessRefreshDisks(driver, vm, asyncJob) < 0)
- goto cleanup;
-
if (flags & VIR_QEMU_PROCESS_START_AUTODESTROY &&
qemuProcessAutoDestroyAdd(driver, vm, conn) < 0)
goto cleanup;
}
+/**
+ * qemuProcessRefreshState:
+ * @driver: qemu driver data
+ * @vm: domain to refresh
+ * @asyncJob: async job type
+ *
+ * This function gathers calls to refresh qemu state after startup. This
+ * function is called after a deferred migration finishes so that we can update
+ * state influenced by the migration stream.
+ */
+static int
+qemuProcessRefreshState(virQEMUDriverPtr driver,
+ virDomainObjPtr vm,
+ qemuDomainAsyncJob asyncJob)
+{
+ VIR_DEBUG("Fetching list of active devices");
+ if (qemuDomainUpdateDeviceList(driver, vm, asyncJob) < 0)
+ return -1;
+
+ VIR_DEBUG("Updating info of memory devices");
+ if (qemuDomainUpdateMemoryDeviceInfo(driver, vm, asyncJob) < 0)
+ return -1;
+
+ VIR_DEBUG("Detecting actual memory size for video device");
+ if (qemuProcessUpdateVideoRamSize(driver, vm, asyncJob) < 0)
+ return -1;
+
+ VIR_DEBUG("Updating disk data");
+ if (qemuProcessRefreshDisks(driver, vm, asyncJob) < 0)
+ return -1;
+
+ return 0;
+}
+
+
/**
* qemuProcessFinishStartup:
*
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
int ret = -1;
+ if (qemuProcessRefreshState(driver, vm, asyncJob) < 0)
+ goto cleanup;
+
if (startCPUs) {
VIR_DEBUG("Starting domain CPUs");
if (qemuProcessStartCPUs(driver, vm, conn,