This patch moves qemuDomainTrackJob() as virDomainTrackJob() into
hypervisor because it is called in begin job and end job
functions that will be generalized in the following series.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/hypervisor/domain_job.c | 6 ++++++
src/hypervisor/domain_job.h | 2 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_domainjob.c | 13 +++----------
src/qemu/qemu_domainjob.h | 2 --
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/hypervisor/domain_job.c b/src/hypervisor/domain_job.c
index 2a19811670..08e84d575f 100644
--- a/src/hypervisor/domain_job.c
+++ b/src/hypervisor/domain_job.c
@@ -220,3 +220,9 @@ virDomainObjClearJob(virDomainJobObj *job)
if (job->cb)
g_clear_pointer(&job->privateData, job->cb->freeJobPrivate);
}
+
+bool
+virDomainTrackJob(virDomainJob job)
+{
+ return (VIR_DOMAIN_TRACK_JOBS & JOB_MASK(job)) != 0;
+}
diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h
index 53ce6706d4..824876b460 100644
--- a/src/hypervisor/domain_job.h
+++ b/src/hypervisor/domain_job.h
@@ -220,3 +220,5 @@ int virDomainObjPreserveJob(virDomainJobObj *currJob,
void virDomainObjClearJob(virDomainJobObj *job);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virDomainJobObj, virDomainObjClearJob);
+
+bool virDomainTrackJob(virDomainJob job);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 0e355abd69..4c35e2a945 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1596,6 +1596,7 @@ virDomainObjPreserveJob;
virDomainObjResetAgentJob;
virDomainObjResetAsyncJob;
virDomainObjResetJob;
+virDomainTrackJob;
# hypervisor/virclosecallbacks.h
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index f323f28c77..f92ec44cb7 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -185,13 +185,6 @@ qemuDomainObjRestoreAsyncJob(virDomainObj *vm,
}
-bool
-qemuDomainTrackJob(virDomainJob job)
-{
- return (VIR_DOMAIN_TRACK_JOBS & JOB_MASK(job)) != 0;
-}
-
-
int
qemuDomainJobDataUpdateTime(virDomainJobData *jobData)
{
@@ -870,7 +863,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver,
priv->job.agentStarted = now;
}
- if (qemuDomainTrackJob(job))
+ if (virDomainTrackJob(job))
qemuDomainSaveStatus(obj);
return 0;
@@ -1092,7 +1085,7 @@ qemuDomainObjEndJob(virDomainObj *obj)
obj, obj->def->name);
virDomainObjResetJob(&priv->job);
- if (qemuDomainTrackJob(job))
+ if (virDomainTrackJob(job))
qemuDomainSaveStatus(obj);
/* We indeed need to wake up ALL threads waiting because
* grabbing a job requires checking more variables. */
@@ -1156,7 +1149,7 @@ qemuDomainObjPrivateXMLFormatJob(virBuffer *buf,
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
virDomainJob job = priv->job.active;
- if (!qemuDomainTrackJob(job))
+ if (!virDomainTrackJob(job))
job = VIR_JOB_NONE;
if (job == VIR_JOB_NONE &&
diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h
index eed94cd87c..7f2869bb41 100644
--- a/src/qemu/qemu_domainjob.h
+++ b/src/qemu/qemu_domainjob.h
@@ -131,8 +131,6 @@ int qemuDomainJobDataToParams(virDomainJobData *jobData,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4);
-bool qemuDomainTrackJob(virDomainJob job);
-
int
qemuDomainObjPrivateXMLFormatJob(virBuffer *buf,
virDomainObj *vm);
--
2.37.1