Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/lxc/lxc_domain.c | 4 +++-
src/lxc/lxc_domain.h | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c
index fae56b35fb..5064f942b9 100644
--- a/src/lxc/lxc_domain.c
+++ b/src/lxc/lxc_domain.c
@@ -143,7 +143,7 @@ virLXCDomainObjEndJob(virLXCDriver *driver G_GNUC_UNUSED,
static void *
-virLXCDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
+virLXCDomainObjPrivateAlloc(void *opaque)
{
virLXCDomainObjPrivate *priv = g_new0(virLXCDomainObjPrivate, 1);
@@ -152,6 +152,8 @@ virLXCDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
return NULL;
}
+ priv->driver = opaque;
+
return priv;
}
diff --git a/src/lxc/lxc_domain.h b/src/lxc/lxc_domain.h
index 1c4cb8c14a..d91dcca04b 100644
--- a/src/lxc/lxc_domain.h
+++ b/src/lxc/lxc_domain.h
@@ -63,6 +63,7 @@ struct virLXCDomainJobObj {
typedef struct _virLXCDomainObjPrivate virLXCDomainObjPrivate;
struct _virLXCDomainObjPrivate {
+ virLXCDriver *driver;
virLXCMonitor *monitor;
bool doneStopEvent;
int stopReason;
--
2.35.3