mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
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:
parent
c6d2d2d7a5
commit
b85cef1b2d
@ -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
|
||||
|
@ -51,8 +51,6 @@ struct libxlDomainJobObj {
|
||||
|
||||
typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate;
|
||||
struct _libxlDomainObjPrivate {
|
||||
virObjectLockable parent;
|
||||
|
||||
/* console */
|
||||
virChrdevs *devs;
|
||||
libxl_evgen_domain_death *deathW;
|
||||
|
Loading…
Reference in New Issue
Block a user