As in commit 88dc7e0c2fb, the helper can be used in cases where the
function actually does not access anyting in the private data besides
the agent.
---
src/qemu/qemu_domain.c | 12 ++++++++++++
src/qemu/qemu_domain.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ed21245..c7687b7 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1873,6 +1873,18 @@ qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
}
+/**
+ * qemuDomainGetAgent:
+ * @vm: domain object
+ *
+ * Returns the agent pointer of @vm;
+ */
+qemuAgentPtr
+qemuDomainGetAgent(virDomainObjPtr vm)
+{
+ return (((qemuDomainObjPrivatePtr)(vm->privateData))->agent);
+}
+
/*
* obj must be locked before calling
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 14892fd..31c7d33 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -298,6 +298,7 @@ int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver,
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_RETURN_CHECK;
+qemuAgentPtr qemuDomainGetAgent(virDomainObjPtr vm);
void qemuDomainObjEnterAgent(virDomainObjPtr obj)
ATTRIBUTE_NONNULL(1);
void qemuDomainObjExitAgent(virDomainObjPtr obj)
--
2.6.2