On Thu, Nov 12, 2015 at 19:37:08 +0100, Jiri Denemark wrote:
We only started an async job for incoming migration from another
host.
When we were starting a domain from scratch or restoring from a saved
state (migration from file) we didn't set any async job. Let's introduce
a new QEMU_ASYNC_JOB_START for these cases.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_domain.c | 3 +++
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 72 +++++++++++++++++++++++++++----------------------
src/qemu/qemu_process.c | 30 ++++++++++++++++++++-
src/qemu/qemu_process.h | 7 ++++-
5 files changed, 79 insertions(+), 34 deletions(-)
[...]
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 638ad02..f85e876 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3412,6 +3412,10 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver,
}
break;
+ case QEMU_ASYNC_JOB_START:
+ /* Already handled in VIR_DOMAIN_PAUSED_STARTING_UP check. */
+ break;
+
case QEMU_ASYNC_JOB_NONE:
case QEMU_ASYNC_JOB_LAST:
break;
@@ -4197,10 +4201,34 @@ qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps,
}
+int
+qemuProcessBeginJob(virQEMUDriverPtr driver,
+ virDomainObjPtr vm)
At least this one deserves a comment. You should state the fact that
users shall use QEMU_ASYNC_JOB_START for the corresponding functions
later on.
+{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+
+ if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_START) < 0)
+ return -1;
+
+ qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE);
+ priv->job.current->type = VIR_DOMAIN_JOB_UNBOUNDED;
+
+ return 0;
+}
ACK