bhyve: Store 'driver' in VM private data

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>
This commit is contained in:
Peter Krempa 2022-05-02 15:17:31 +02:00
parent 49ef0f95c6
commit f5c8abf176
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -27,6 +27,8 @@
typedef struct _bhyveDomainObjPrivate bhyveDomainObjPrivate;
struct _bhyveDomainObjPrivate {
struct _bhyveConn *driver;
virDomainPCIAddressSet *pciaddrs;
bool persistentAddrs;