Although these and functions in the following two patches are for
now just being used by the qemu driver, it makes sense to have all
begin job functions in the same file.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
docs/kbase/internals/qemu-threads.rst | 10 ++--
src/conf/virdomainjob.c | 34 +++++++++++
src/conf/virdomainjob.h | 4 ++
src/libvirt_private.syms | 2 +
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domainjob.c | 34 -----------
src/qemu/qemu_domainjob.h | 4 --
src/qemu/qemu_driver.c | 82 +++++++++++++--------------
src/qemu/qemu_snapshot.c | 10 ++--
9 files changed, 92 insertions(+), 90 deletions(-)
diff --git a/docs/kbase/internals/qemu-threads.rst
b/docs/kbase/internals/qemu-threads.rst
index 22d12f61a5..afdf9e61cc 100644
--- a/docs/kbase/internals/qemu-threads.rst
+++ b/docs/kbase/internals/qemu-threads.rst
@@ -62,7 +62,7 @@ There are a number of locks on various objects
Agent job condition is then used when thread wishes to talk to qemu
agent monitor. It is possible to acquire just agent job
- (``qemuDomainObjBeginAgentJob``), or only normal job (``virDomainObjBeginJob``)
+ (``virDomainObjBeginAgentJob``), or only normal job (``virDomainObjBeginJob``)
but not both at the same time. Holding an agent job and a normal job would
allow an unresponsive or malicious agent to block normal libvirt API and
potentially result in a denial of service. Which type of job to grab
@@ -130,11 +130,11 @@ To acquire the normal job condition
To acquire the agent job condition
- ``qemuDomainObjBeginAgentJob()``
+ ``virDomainObjBeginAgentJob()``
- Waits until there is no other agent job set
- Sets ``job.agentActive`` to the job type
- ``qemuDomainObjEndAgentJob()``
+ ``virDomainObjEndAgentJob()``
- Sets ``job.agentActive`` to 0
- Signals on ``job.cond`` condition
@@ -253,7 +253,7 @@ Design patterns
obj = qemuDomObjFromDomain(dom);
- qemuDomainObjBeginAgentJob(obj, VIR_AGENT_JOB_TYPE);
+ virDomainObjBeginAgentJob(obj, VIR_AGENT_JOB_TYPE);
...do prep work...
@@ -266,7 +266,7 @@ Design patterns
...do final work...
- qemuDomainObjEndAgentJob(obj);
+ virDomainObjEndAgentJob(obj);
virDomainObjEndAPI(&obj);
diff --git a/src/conf/virdomainjob.c b/src/conf/virdomainjob.c
index 0f239c680c..f91a606d84 100644
--- a/src/conf/virdomainjob.c
+++ b/src/conf/virdomainjob.c
@@ -527,6 +527,22 @@ int virDomainObjBeginJob(virDomainObj *obj,
return 0;
}
+/**
+ * virDomainObjBeginAgentJob:
+ *
+ * Grabs agent type of job. Use if caller talks to guest agent only.
+ *
+ * To end job call virDomainObjEndAgentJob.
+ */
+int
+virDomainObjBeginAgentJob(virDomainObj *obj,
+ virDomainAgentJob agentJob)
+{
+ return virDomainObjBeginJobInternal(obj, obj->job, VIR_JOB_NONE,
+ agentJob,
+ VIR_ASYNC_JOB_NONE, false);
+}
+
/*
* obj must be locked and have a reference before calling
*
@@ -554,3 +570,21 @@ virDomainObjEndJob(virDomainObj *obj)
* grabbing a job requires checking more variables. */
virCondBroadcast(&obj->job->cond);
}
+
+void
+virDomainObjEndAgentJob(virDomainObj *obj)
+{
+ virDomainAgentJob agentJob = obj->job->agentActive;
+
+ obj->job->jobsQueued--;
+
+ VIR_DEBUG("Stopping agent job: %s (async=%s vm=%p name=%s)",
+ virDomainAgentJobTypeToString(agentJob),
+ virDomainAsyncJobTypeToString(obj->job->asyncJob),
+ obj, obj->def->name);
+
+ virDomainObjResetAgentJob(obj->job);
+ /* We indeed need to wake up ALL threads waiting because
+ * grabbing a job requires checking more variables. */
+ virCondBroadcast(&obj->job->cond);
+}
diff --git a/src/conf/virdomainjob.h b/src/conf/virdomainjob.h
index 7a06c384f3..6cec322af1 100644
--- a/src/conf/virdomainjob.h
+++ b/src/conf/virdomainjob.h
@@ -249,5 +249,9 @@ int virDomainObjBeginJobInternal(virDomainObj *obj,
int virDomainObjBeginJob(virDomainObj *obj,
virDomainJob job)
G_GNUC_WARN_UNUSED_RESULT;
+int virDomainObjBeginAgentJob(virDomainObj *obj,
+ virDomainAgentJob agentJob)
+ G_GNUC_WARN_UNUSED_RESULT;
void virDomainObjEndJob(virDomainObj *obj);
+void virDomainObjEndAgentJob(virDomainObj *obj);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 77da4a1d01..05b27d6725 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1187,10 +1187,12 @@ virDomainJobStatusToType;
virDomainJobTypeFromString;
virDomainJobTypeToString;
virDomainNestedJobAllowed;
+virDomainObjBeginAgentJob;
virDomainObjBeginJob;
virDomainObjBeginJobInternal;
virDomainObjCanSetJob;
virDomainObjClearJob;
+virDomainObjEndAgentJob;
virDomainObjEndJob;
virDomainObjInitJob;
virDomainObjPreserveJob;
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 3514f104f1..197be6a4d1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6057,7 +6057,7 @@ qemuDomainObjEnterMonitorAsync(virDomainObj *obj,
* obj must be locked before calling
*
* To be called immediately before any QEMU agent API call.
- * Must have already called qemuDomainObjBeginAgentJob() and
+ * Must have already called virDomainObjBeginAgentJob() and
* checked that the VM is still active.
*
* To be followed with qemuDomainObjExitAgent() once complete
diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c
index a8baf096e5..0775e04add 100644
--- a/src/qemu/qemu_domainjob.c
+++ b/src/qemu/qemu_domainjob.c
@@ -655,22 +655,6 @@ qemuDomainObjReleaseAsyncJob(virDomainObj *obj)
obj->job->asyncOwner = 0;
}
-/**
- * qemuDomainObjBeginAgentJob:
- *
- * Grabs agent type of job. Use if caller talks to guest agent only.
- *
- * To end job call qemuDomainObjEndAgentJob.
- */
-int
-qemuDomainObjBeginAgentJob(virDomainObj *obj,
- virDomainAgentJob agentJob)
-{
- return virDomainObjBeginJobInternal(obj, obj->job, VIR_JOB_NONE,
- agentJob,
- VIR_ASYNC_JOB_NONE, false);
-}
-
int qemuDomainObjBeginAsyncJob(virDomainObj *obj,
virDomainAsyncJob asyncJob,
virDomainJobOperation operation,
@@ -730,24 +714,6 @@ qemuDomainObjBeginJobNowait(virDomainObj *obj,
VIR_ASYNC_JOB_NONE, true);
}
-void
-qemuDomainObjEndAgentJob(virDomainObj *obj)
-{
- virDomainAgentJob agentJob = obj->job->agentActive;
-
- obj->job->jobsQueued--;
-
- VIR_DEBUG("Stopping agent job: %s (async=%s vm=%p name=%s)",
- virDomainAgentJobTypeToString(agentJob),
- virDomainAsyncJobTypeToString(obj->job->asyncJob),
- obj, obj->def->name);
-
- virDomainObjResetAgentJob(obj->job);
- /* We indeed need to wake up ALL threads waiting because
- * grabbing a job requires checking more variables. */
- virCondBroadcast(&obj->job->cond);
-}
-
void
qemuDomainObjEndAsyncJob(virDomainObj *obj)
{
diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h
index 918b74748b..0cc4dc44f3 100644
--- a/src/qemu/qemu_domainjob.h
+++ b/src/qemu/qemu_domainjob.h
@@ -69,9 +69,6 @@ int qemuDomainAsyncJobPhaseFromString(virDomainAsyncJob job,
void qemuDomainEventEmitJobCompleted(virQEMUDriver *driver,
virDomainObj *vm);
-int qemuDomainObjBeginAgentJob(virDomainObj *obj,
- virDomainAgentJob agentJob)
- G_GNUC_WARN_UNUSED_RESULT;
int qemuDomainObjBeginAsyncJob(virDomainObj *obj,
virDomainAsyncJob asyncJob,
virDomainJobOperation operation,
@@ -84,7 +81,6 @@ int qemuDomainObjBeginJobNowait(virDomainObj *obj,
virDomainJob job)
G_GNUC_WARN_UNUSED_RESULT;
-void qemuDomainObjEndAgentJob(virDomainObj *obj);
void qemuDomainObjEndAsyncJob(virDomainObj *obj);
void qemuDomainObjAbortAsyncJob(virDomainObj *obj);
void qemuDomainObjSetJobPhase(virDomainObj *obj,
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 666e8dd228..443b4f679a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1780,7 +1780,7 @@ qemuDomainShutdownFlagsAgent(virDomainObj *vm,
int agentFlag = isReboot ? QEMU_AGENT_SHUTDOWN_REBOOT :
QEMU_AGENT_SHUTDOWN_POWERDOWN;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
return -1;
if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
@@ -1798,7 +1798,7 @@ qemuDomainShutdownFlagsAgent(virDomainObj *vm,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
return ret;
}
@@ -1908,7 +1908,7 @@ qemuDomainRebootAgent(virDomainObj *vm,
if (!isReboot)
agentFlag = QEMU_AGENT_SHUTDOWN_POWERDOWN;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
return -1;
if (!qemuDomainAgentAvailable(vm, agentForced))
@@ -1923,7 +1923,7 @@ qemuDomainRebootAgent(virDomainObj *vm,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
return ret;
}
@@ -4366,7 +4366,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom,
if (useAgent) {
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
} else {
if (virDomainObjBeginJob(vm, VIR_JOB_MODIFY) < 0)
@@ -4386,7 +4386,7 @@ qemuDomainSetVcpusFlags(virDomainPtr dom,
endjob:
if (useAgent)
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
else
virDomainObjEndJob(vm);
@@ -4807,7 +4807,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
goto cleanup;
if (flags & VIR_DOMAIN_VCPU_GUEST) {
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (!virDomainObjIsActive(vm)) {
@@ -4825,7 +4825,7 @@ qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags)
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
if (ncpuinfo < 0)
goto cleanup;
@@ -16601,7 +16601,7 @@ qemuDomainPMSuspendAgent(virDomainObj *vm,
qemuAgent *agent;
int ret = -1;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
return -1;
if (virDomainObjCheckActive(vm) < 0)
@@ -16615,7 +16615,7 @@ qemuDomainPMSuspendAgent(virDomainObj *vm,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
return ret;
}
@@ -16767,7 +16767,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
if (virDomainQemuAgentCommandEnsureACL(domain->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0)
@@ -16785,7 +16785,7 @@ qemuDomainQemuAgentCommand(virDomainPtr domain,
VIR_FREE(result);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -16861,7 +16861,7 @@ qemuDomainFSTrim(virDomainPtr dom,
if (virDomainFSTrimEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -16875,7 +16875,7 @@ qemuDomainFSTrim(virDomainPtr dom,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -17031,7 +17031,7 @@ qemuDomainGetHostnameAgent(virDomainObj *vm,
qemuAgent *agent;
int ret = -1;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
return -1;
if (virDomainObjCheckActive(vm) < 0)
@@ -17046,7 +17046,7 @@ qemuDomainGetHostnameAgent(virDomainObj *vm,
ret = 0;
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
return ret;
}
@@ -17172,7 +17172,7 @@ qemuDomainGetTime(virDomainPtr dom,
if (virDomainGetTimeEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0)
@@ -17191,7 +17191,7 @@ qemuDomainGetTime(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -17208,7 +17208,7 @@ qemuDomainSetTimeAgent(virDomainObj *vm,
qemuAgent *agent;
int ret = -1;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
return -1;
if (virDomainObjCheckActive(vm) < 0)
@@ -17222,7 +17222,7 @@ qemuDomainSetTimeAgent(virDomainObj *vm,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
return ret;
}
@@ -17308,7 +17308,7 @@ qemuDomainFSFreeze(virDomainPtr dom,
if (virDomainFSFreezeEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0)
@@ -17317,7 +17317,7 @@ qemuDomainFSFreeze(virDomainPtr dom,
ret = qemuSnapshotFSFreeze(vm, mountpoints, nmountpoints);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -17348,7 +17348,7 @@ qemuDomainFSThaw(virDomainPtr dom,
if (virDomainFSThawEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0)
@@ -17357,7 +17357,7 @@ qemuDomainFSThaw(virDomainPtr dom,
ret = qemuSnapshotFSThaw(vm, true);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -18880,7 +18880,7 @@ qemuDomainGetFSInfoAgent(virDomainObj *vm,
int ret = -1;
qemuAgent *agent;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
return ret;
if (virDomainObjCheckActive(vm) < 0)
@@ -18894,7 +18894,7 @@ qemuDomainGetFSInfoAgent(virDomainObj *vm,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
return ret;
}
@@ -19039,7 +19039,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom,
break;
case VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_AGENT:
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -19050,7 +19050,7 @@ qemuDomainInterfaceAddresses(virDomainPtr dom,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
break;
@@ -19090,7 +19090,7 @@ qemuDomainSetUserPassword(virDomainPtr dom,
if (virDomainSetUserPasswordEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0)
@@ -19110,7 +19110,7 @@ qemuDomainSetUserPassword(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
@@ -19393,7 +19393,7 @@ qemuDomainGetGuestVcpus(virDomainPtr dom,
if (virDomainGetGuestVcpusEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -19412,7 +19412,7 @@ qemuDomainGetGuestVcpus(virDomainPtr dom,
ret = 0;
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
VIR_FREE(info);
@@ -19451,7 +19451,7 @@ qemuDomainSetGuestVcpus(virDomainPtr dom,
if (virDomainSetGuestVcpusEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -19497,7 +19497,7 @@ qemuDomainSetGuestVcpus(virDomainPtr dom,
qemuDomainObjExitAgent(vm, agent);
endjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
VIR_FREE(info);
@@ -20412,7 +20412,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
if (virDomainGetGuestInfoEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -20470,7 +20470,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
}
qemuDomainObjExitAgent(vm, agent);
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
if (nfs > 0 || ndisks > 0) {
if (virDomainObjBeginJob(vm, VIR_JOB_QUERY) < 0)
@@ -20517,7 +20517,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
qemuDomainObjExitAgent(vm, agent);
endagentjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
goto cleanup;
}
@@ -20588,7 +20588,7 @@ qemuDomainAuthorizedSSHKeysGet(virDomainPtr dom,
if (virDomainAuthorizedSshKeysGetEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -20599,7 +20599,7 @@ qemuDomainAuthorizedSSHKeysGet(virDomainPtr dom,
qemuDomainObjExitAgent(vm, agent);
endagentjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
return rv;
@@ -20628,7 +20628,7 @@ qemuDomainAuthorizedSSHKeysSet(virDomainPtr dom,
if (virDomainAuthorizedSshKeysSetEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_QUERY) < 0)
goto cleanup;
if (!qemuDomainAgentAvailable(vm, true))
@@ -20642,7 +20642,7 @@ qemuDomainAuthorizedSSHKeysSet(virDomainPtr dom,
qemuDomainObjExitAgent(vm, agent);
endagentjob:
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
cleanup:
virDomainObjEndAPI(&vm);
return rv;
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index afed0f0e28..c5e5e3ed5b 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -1277,16 +1277,16 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE) {
int frozen;
- if (qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
+ if (virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) < 0)
goto cleanup;
if (virDomainObjCheckActive(vm) < 0) {
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
goto cleanup;
}
frozen = qemuSnapshotFSFreeze(vm, NULL, 0);
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
if (frozen < 0)
goto cleanup;
@@ -1422,13 +1422,13 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *driver,
}
if (thaw &&
- qemuDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) >= 0 &&
+ virDomainObjBeginAgentJob(vm, VIR_AGENT_JOB_MODIFY) >= 0 &&
virDomainObjIsActive(vm)) {
/* report error only on an otherwise successful snapshot */
if (qemuSnapshotFSThaw(vm, ret == 0) < 0)
ret = -1;
- qemuDomainObjEndAgentJob(vm);
+ virDomainObjEndAgentJob(vm);
}
virQEMUSaveDataFree(data);
--
2.37.1