]> xenbits.xensource.com Git - libvirt.git/commitdiff
bhyve: Store 'driver' in VM private data
authorPeter Krempa <pkrempa@redhat.com>
Mon, 2 May 2022 13:17:31 +0000 (15:17 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 May 2022 17:31:08 +0000 (19:31 +0200)
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@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/bhyve/bhyve_domain.c
src/bhyve/bhyve_domain.h

index b526235a4ed46abddb94fd92e82b0c13bfe2798f..69555a3efcf64da27088233dea82abd06992eeb5 100644 (file)
 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
index 89a4a3c7cb80453a0ae69ae7235c13090a14549c..5a539bc4c02cdcc8907c07d0395dd785b306057b 100644 (file)
@@ -27,6 +27,8 @@
 
 typedef struct _bhyveDomainObjPrivate bhyveDomainObjPrivate;
 struct _bhyveDomainObjPrivate {
+    struct _bhyveConn *driver;
+
     virDomainPCIAddressSet *pciaddrs;
     bool persistentAddrs;