qemu & hypervisor: move qemuDomainTrackJob() into hypervisor

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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Kristina Hanicova 2022-08-03 14:43:20 +02:00 committed by Michal Privoznik
parent d6f3cd75d7
commit 6260204c7f
5 changed files with 12 additions and 12 deletions

View File

@ -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;
}

View File

@ -220,3 +220,5 @@ int virDomainObjPreserveJob(virDomainJobObj *currJob,
void virDomainObjClearJob(virDomainJobObj *job);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virDomainJobObj, virDomainObjClearJob);
bool virDomainTrackJob(virDomainJob job);

View File

@ -1600,6 +1600,7 @@ virDomainObjPreserveJob;
virDomainObjResetAgentJob;
virDomainObjResetAsyncJob;
virDomainObjResetJob;
virDomainTrackJob;
# hypervisor/virclosecallbacks.h

View File

@ -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 &&

View File

@ -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);