goto endjob;
}
+ /* Now that the state data was transferred we can refresh the actual state
+ * of the devices */
+ if (qemuProcessRefreshState(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN) < 0) {
+ /* Similarly to the case above v2 protocol will not be able to recover
+ * from this. Let's ignore this and perhaps stuff will not break. */
+ if (v3proto)
+ goto endjob;
+ }
+
if (priv->job.current->status == QEMU_DOMAIN_JOB_STATUS_POSTCOPY)
inPostCopy = true;
* function is called after a deferred migration finishes so that we can update
* state influenced by the migration stream.
*/
-static int
+int
qemuProcessRefreshState(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob)
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,
VIR_DOMAIN_PAUSED_USER) < 0)
goto stop;
- /* Keep watching qemu log for errors during incoming migration, otherwise
- * unset reporting errors from qemu log. */
- if (!incoming)
+ if (!incoming) {
+ /* Keep watching qemu log for errors during incoming migration, otherwise
+ * unset reporting errors from qemu log. */
qemuMonitorSetDomainLog(priv->mon, NULL, NULL, NULL);
+ /* Refresh state of devices from qemu. During migration this needs to
+ * happen after the state information is fully transferred. */
+ if (qemuProcessRefreshState(driver, vm, asyncJob) < 0)
+ goto stop;
+ }
+
ret = 0;
cleanup:
bool startCPUs,
virDomainPausedReason pausedReason);
+int qemuProcessRefreshState(virQEMUDriverPtr driver,
+ virDomainObjPtr vm,
+ qemuDomainAsyncJob asyncJob);
+
typedef enum {
VIR_QEMU_PROCESS_STOP_MIGRATED = 1 << 0,
VIR_QEMU_PROCESS_STOP_NO_RELABEL = 1 << 1,