Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/hypervisor/domain_job.c | 11 +++++++++++
src/hypervisor/domain_job.h | 4 ++++
src/libvirt_private.syms | 1 +
src/qemu/qemu_domainjob.c | 13 +------------
4 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/src/hypervisor/domain_job.c b/src/hypervisor/domain_job.c
index 6a7116fb2a..0afed46418 100644
--- a/src/hypervisor/domain_job.c
+++ b/src/hypervisor/domain_job.c
@@ -234,3 +234,14 @@ virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob
newJob)
newJob == VIR_JOB_NONE ||
(jobs->mask & JOB_MASK(newJob));
}
+
+bool
+virDomainObjCanSetJob(virDomainJobObj *job,
+ virDomainJob newJob,
+ virDomainAgentJob newAgentJob)
+{
+ return ((newJob == VIR_JOB_NONE ||
+ job->active == VIR_JOB_NONE) &&
+ (newAgentJob == VIR_AGENT_JOB_NONE ||
+ job->agentActive == VIR_AGENT_JOB_NONE));
+}
diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h
index 618fba45bd..30893dabc3 100644
--- a/src/hypervisor/domain_job.h
+++ b/src/hypervisor/domain_job.h
@@ -224,3 +224,7 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virDomainJobObj,
virDomainObjClearJob);
bool virDomainTrackJob(virDomainJob job);
bool virDomainNestedJobAllowed(virDomainJobObj *jobs, virDomainJob newJob);
+
+bool virDomainObjCanSetJob(virDomainJobObj *job,
+ virDomainJob newJob,
+ virDomainAgentJob newAgentJob);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 16117970f2..9f6389ae63 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1591,6 +1591,7 @@ virDomainJobStatusToType;
virDomainJobTypeFromString;
virDomainJobTypeToString;
virDomainNestedJobAllowed;
+virDomainObjCanSetJob;
virDomainObjClearJob;
virDomainObjInitJob;
virDomainObjPreserveJob;
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index 46fb2d704b..d682f7be38 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -697,17 +697,6 @@ qemuDomainObjReleaseAsyncJob(virDomainObj *obj)
priv->job.asyncOwner = 0;
}
-static bool
-qemuDomainObjCanSetJob(virDomainJobObj *job,
- virDomainJob newJob,
- virDomainAgentJob newAgentJob)
-{
- return ((newJob == VIR_JOB_NONE ||
- job->active == VIR_JOB_NONE) &&
- (newAgentJob == VIR_AGENT_JOB_NONE ||
- job->agentActive == VIR_AGENT_JOB_NONE));
-}
-
/* Give up waiting for mutex after 30 seconds */
#define QEMU_JOB_WAIT_TIME (1000ull * 30)
@@ -788,7 +777,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
goto error;
}
- while (!qemuDomainObjCanSetJob(&priv->job, job, agentJob)) {
+ while (!virDomainObjCanSetJob(&priv->job, job, agentJob)) {
if (nowait)
goto cleanup;
--
2.37.1