This patch moves qemuDomainObjResetAgentJob() as virDomainObjResetAgentJob() into hypervisor. Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx> --- src/hypervisor/domain_job.c | 9 +++++++++ src/hypervisor/domain_job.h | 2 ++ src/libvirt_private.syms | 1 + src/qemu/qemu_domainjob.c | 14 ++------------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/hypervisor/domain_job.c b/src/hypervisor/domain_job.c index 5b97624287..9fbea500c4 100644 --- a/src/hypervisor/domain_job.c +++ b/src/hypervisor/domain_job.c @@ -146,3 +146,12 @@ virDomainObjResetJob(virDomainJobObj *job) g_clear_pointer(&job->ownerAPI, g_free); job->started = 0; } + +void +virDomainObjResetAgentJob(virDomainJobObj *job) +{ + job->agentActive = VIR_AGENT_JOB_NONE; + job->agentOwner = 0; + g_clear_pointer(&job->agentOwnerAPI, g_free); + job->agentStarted = 0; +} diff --git a/src/hypervisor/domain_job.h b/src/hypervisor/domain_job.h index 4c32296117..7a9197cbde 100644 --- a/src/hypervisor/domain_job.h +++ b/src/hypervisor/domain_job.h @@ -210,3 +210,5 @@ int virDomainObjInitJob(virDomainJobObj *job, virDomainObjPrivateJobCallbacks *cb); void virDomainObjResetJob(virDomainJobObj *job); + +void virDomainObjResetAgentJob(virDomainJobObj *job); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d5046604dd..a50f9aea28 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1591,6 +1591,7 @@ virDomainJobStatusToType; virDomainJobTypeFromString; virDomainJobTypeToString; virDomainObjInitJob; +virDomainObjResetAgentJob; virDomainObjResetJob; diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index a45103256a..0f3b38108c 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -150,16 +150,6 @@ qemuDomainEventEmitJobCompleted(virQEMUDriver *driver, } -static void -qemuDomainObjResetAgentJob(virDomainJobObj *job) -{ - job->agentActive = VIR_AGENT_JOB_NONE; - job->agentOwner = 0; - g_clear_pointer(&job->agentOwnerAPI, g_free); - job->agentStarted = 0; -} - - static void qemuDomainObjResetAsyncJob(virDomainJobObj *job) { @@ -936,7 +926,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriver *driver, } if (agentJob) { - qemuDomainObjResetAgentJob(&priv->job); + virDomainObjResetAgentJob(&priv->job); VIR_DEBUG("Started agent job: %s (vm=%p name=%s job=%s async=%s)", virDomainAgentJobTypeToString(agentJob), @@ -1191,7 +1181,7 @@ qemuDomainObjEndAgentJob(virDomainObj *obj) virDomainAsyncJobTypeToString(priv->job.asyncJob), obj, obj->def->name); - qemuDomainObjResetAgentJob(&priv->job); + virDomainObjResetAgentJob(&priv->job); /* We indeed need to wake up ALL threads waiting because * grabbing a job requires checking more variables. */ virCondBroadcast(&priv->job.cond); -- 2.37.1