提交 8ab12f1a 编写于 作者: X Xing Lin 提交者: Cole Robinson

qemu_migration.c: sleep first before checking for migration status.

The problem with the previous implementation is,
even when qemuMigrationUpdateJobStatus() detects a migration job
has completed, it will do a sleep for 50 ms (which is unnecessary
and only adds up to the VM pause time).
Signed-off-by: NXing Lin <xinglin@cs.utah.edu>
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 522e81cb)
上级 d17b2d9d
......@@ -2369,7 +2369,7 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver,
jobInfo->type = VIR_DOMAIN_JOB_UNBOUNDED;
while (jobInfo->type == VIR_DOMAIN_JOB_UNBOUNDED) {
while (1) {
/* Poll every 50ms for progress & to allow cancellation */
struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull };
......@@ -2391,6 +2391,9 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver,
break;
}
if (jobInfo->type != VIR_DOMAIN_JOB_UNBOUNDED)
break;
virObjectUnlock(vm);
nanosleep(&ts, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册