lxc: 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 f5c8abf176
commit 6871553c3f
2 changed files with 4 additions and 1 deletions

View File

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

View File

@ -63,6 +63,7 @@ struct virLXCDomainJobObj {
typedef struct _virLXCDomainObjPrivate virLXCDomainObjPrivate;
struct _virLXCDomainObjPrivate {
virLXCDriver *driver;
virLXCMonitor *monitor;
bool doneStopEvent;
int stopReason;