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/bhyve/bhyve_domain.c | 8 ++++++--
src/bhyve/bhyve_domain.h | 2 ++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
index b526235a4e..69555a3efc 100644
--- a/src/bhyve/bhyve_domain.c
+++ b/src/bhyve/bhyve_domain.c
@@ -34,9 +34,13 @@
VIR_LOG_INIT("bhyve.bhyve_domain");
static void *
-bhyveDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
+bhyveDomainObjPrivateAlloc(void *opaque)
{
- return g_new0(bhyveDomainObjPrivate, 1);
+ bhyveDomainObjPrivate *priv = g_new0(bhyveDomainObjPrivate, 1);
+
+ priv->driver = opaque;
+
+ return priv;
}
static void
diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h
index 89a4a3c7cb..5a539bc4c0 100644
--- a/src/bhyve/bhyve_domain.h
+++ b/src/bhyve/bhyve_domain.h
@@ -27,6 +27,8 @@
typedef struct _bhyveDomainObjPrivate bhyveDomainObjPrivate;
struct _bhyveDomainObjPrivate {
+ struct _bhyveConn *driver;
+
virDomainPCIAddressSet *pciaddrs;
bool persistentAddrs;
--
2.35.3