libxl: Don't derive libxlDomainObjPrivate from virObjectLockable

The libxlDomainObjPrivate object is never locked and hence does not need to
be a virObjectLockable object.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Jim Fehlig 2021-11-22 10:54:04 -07:00
parent c6d2d2d7a5
commit b85cef1b2d
2 changed files with 6 additions and 34 deletions

View File

@ -51,21 +51,6 @@ VIR_ENUM_IMPL(libxlDomainJob,
"modify",
);
static virClass *libxlDomainObjPrivateClass;
static void
libxlDomainObjPrivateDispose(void *obj);
static int
libxlDomainObjPrivateOnceInit(void)
{
if (!VIR_CLASS_NEW(libxlDomainObjPrivate, virClassForObjectLockable()))
return -1;
return 0;
}
VIR_ONCE_GLOBAL_INIT(libxlDomainObjPrivate);
static int
libxlDomainObjInitJob(libxlDomainObjPrivate *priv)
@ -206,42 +191,31 @@ libxlDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED)
{
libxlDomainObjPrivate *priv;
if (libxlDomainObjPrivateInitialize() < 0)
return NULL;
if (!(priv = virObjectLockableNew(libxlDomainObjPrivateClass)))
return NULL;
priv = g_new0(libxlDomainObjPrivate, 1);
if (!(priv->devs = virChrdevAlloc())) {
virObjectUnref(priv);
g_free(priv);
return NULL;
}
if (libxlDomainObjInitJob(priv) < 0) {
virChrdevFree(priv->devs);
virObjectUnref(priv);
g_free(priv);
return NULL;
}
return priv;
}
static void
libxlDomainObjPrivateDispose(void *obj)
{
libxlDomainObjPrivate *priv = obj;
libxlDomainObjFreeJob(priv);
virChrdevFree(priv->devs);
}
static void
libxlDomainObjPrivateFree(void *data)
{
libxlDomainObjPrivate *priv = data;
g_free(priv->lockState);
virObjectUnref(priv);
libxlDomainObjFreeJob(priv);
virChrdevFree(priv->devs);
g_free(priv);
}
static int

View File

@ -51,8 +51,6 @@ struct libxlDomainJobObj {
typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
struct _libxlDomainObjPrivate {
virObjectLockable parent;
/* console */
virChrdevs *devs;
libxl_evgen_domain_death *deathW;