|
|
23265d |
From 2726e0de1158ab7788f16cd91df53a48b882a716 Mon Sep 17 00:00:00 2001
|
|
|
23265d |
Message-Id: <2726e0de1158ab7788f16cd91df53a48b882a716@dist-git>
|
|
|
23265d |
From: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
|
|
|
23265d |
Date: Fri, 1 Sep 2017 09:49:27 +0300
|
|
|
23265d |
Subject: [PATCH] qemu: start all async job with job status active
|
|
|
23265d |
|
|
|
23265d |
Setting status to none has little value - getting job status
|
|
|
23265d |
will not return even elapsed time.
|
|
|
23265d |
|
|
|
23265d |
After this patch getting job stats stays correct in a sence
|
|
|
23265d |
it will not fetch migration stats because it consults
|
|
|
23265d |
stats.status before doing the fetch.
|
|
|
23265d |
|
|
|
23265d |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
23265d |
(cherry picked from commit b6868c3cdd711e012c6cb1ec0e0a3cac4ea92a33)
|
|
|
23265d |
|
|
|
23265d |
https://bugzilla.redhat.com/show_bug.cgi?id=1530130
|
|
|
23265d |
|
|
|
23265d |
Conflicts:
|
|
|
23265d |
src/qemu/qemu_migration.c
|
|
|
23265d |
- commit e87d4b9e2f is not backported
|
|
|
23265d |
|
|
|
23265d |
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
|
|
23265d |
---
|
|
|
23265d |
src/qemu/qemu_domain.c | 1 +
|
|
|
23265d |
src/qemu/qemu_driver.c | 2 --
|
|
|
23265d |
src/qemu/qemu_migration.c | 4 ----
|
|
|
23265d |
src/qemu/qemu_process.c | 4 ----
|
|
|
23265d |
4 files changed, 1 insertion(+), 10 deletions(-)
|
|
|
23265d |
|
|
|
23265d |
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
|
23265d |
index 329ec6e2ce..4b1ead7d0a 100644
|
|
|
23265d |
--- a/src/qemu/qemu_domain.c
|
|
|
23265d |
+++ b/src/qemu/qemu_domain.c
|
|
|
23265d |
@@ -3811,6 +3811,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
|
|
|
23265d |
qemuDomainObjResetAsyncJob(priv);
|
|
|
23265d |
if (VIR_ALLOC(priv->job.current) < 0)
|
|
|
23265d |
goto cleanup;
|
|
|
23265d |
+ priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
|
|
|
23265d |
priv->job.asyncJob = asyncJob;
|
|
|
23265d |
priv->job.asyncOwner = virThreadSelfID();
|
|
|
23265d |
priv->job.asyncOwnerAPI = virThreadJobGet();
|
|
|
23265d |
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
|
23265d |
index ecba87a121..8972897a28 100644
|
|
|
23265d |
--- a/src/qemu/qemu_driver.c
|
|
|
23265d |
+++ b/src/qemu/qemu_driver.c
|
|
|
23265d |
@@ -3299,8 +3299,6 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
|
|
|
23265d |
goto endjob;
|
|
|
23265d |
}
|
|
|
23265d |
|
|
|
23265d |
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
|
|
|
23265d |
-
|
|
|
23265d |
/* Pause */
|
|
|
23265d |
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
|
|
|
23265d |
was_running = true;
|
|
|
23265d |
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
|
|
23265d |
index 1726349f94..9f7aad6680 100644
|
|
|
23265d |
--- a/src/qemu/qemu_migration.c
|
|
|
23265d |
+++ b/src/qemu/qemu_migration.c
|
|
|
23265d |
@@ -1563,7 +1563,6 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver,
|
|
|
23265d |
|
|
|
23265d |
flags |= QEMU_MIGRATION_COMPLETED_UPDATE_STATS;
|
|
|
23265d |
|
|
|
23265d |
- jobInfo->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
|
|
|
23265d |
while ((rv = qemuMigrationCompleted(driver, vm, asyncJob,
|
|
|
23265d |
dconn, flags)) != 1) {
|
|
|
23265d |
if (rv < 0)
|
|
|
23265d |
@@ -5624,7 +5623,6 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
|
|
|
23265d |
virDomainObjPtr vm,
|
|
|
23265d |
qemuDomainAsyncJob job)
|
|
|
23265d |
{
|
|
|
23265d |
- qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
|
23265d |
virDomainJobOperation op;
|
|
|
23265d |
unsigned long long mask;
|
|
|
23265d |
|
|
|
23265d |
@@ -5642,8 +5640,6 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
|
|
|
23265d |
return -1;
|
|
|
23265d |
|
|
|
23265d |
qemuDomainObjSetAsyncJobMask(vm, mask);
|
|
|
23265d |
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
|
|
|
23265d |
-
|
|
|
23265d |
return 0;
|
|
|
23265d |
}
|
|
|
23265d |
|
|
|
23265d |
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
|
23265d |
index 25de367afc..1633652fdc 100644
|
|
|
23265d |
--- a/src/qemu/qemu_process.c
|
|
|
23265d |
+++ b/src/qemu/qemu_process.c
|
|
|
23265d |
@@ -3943,15 +3943,11 @@ qemuProcessBeginJob(virQEMUDriverPtr driver,
|
|
|
23265d |
virDomainObjPtr vm,
|
|
|
23265d |
virDomainJobOperation operation)
|
|
|
23265d |
{
|
|
|
23265d |
- qemuDomainObjPrivatePtr priv = vm->privateData;
|
|
|
23265d |
-
|
|
|
23265d |
if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_START,
|
|
|
23265d |
operation) < 0)
|
|
|
23265d |
return -1;
|
|
|
23265d |
|
|
|
23265d |
qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE);
|
|
|
23265d |
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
|
|
|
23265d |
-
|
|
|
23265d |
return 0;
|
|
|
23265d |
}
|
|
|
23265d |
|
|
|
23265d |
--
|
|
|
23265d |
2.15.1
|
|
|
23265d |
|