mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
domain_conf: drop unused ref-count in snapshot object
The ref count was assigned to 1 at creation, then never modified again until it was decremented just before freeing the object. * src/conf/domain_conf.h (_virDomainSnapshotObj): Delete unused field. (virDomainSnapshotObjUnref): Delete unused prototype. * src/libvirt_private.syms: Likewise. * src/conf/domain_conf.c (virDomainSnapshotObjNew) (virDomainSnapshotObjListDataFree): Update users. (virDomainSnapshotObjUnref): Delete.
This commit is contained in:
parent
206fc979b1
commit
e904ce3c47
@ -8722,8 +8722,6 @@ static virDomainSnapshotObjPtr virDomainSnapshotObjNew(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
snapshot->refs = 1;
|
||||
|
||||
VIR_DEBUG("obj=%p", snapshot);
|
||||
|
||||
return snapshot;
|
||||
@ -8740,17 +8738,6 @@ static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr snapshot)
|
||||
VIR_FREE(snapshot);
|
||||
}
|
||||
|
||||
int virDomainSnapshotObjUnref(virDomainSnapshotObjPtr snapshot)
|
||||
{
|
||||
snapshot->refs--;
|
||||
VIR_DEBUG("obj=%p refs=%d", snapshot, snapshot->refs);
|
||||
if (snapshot->refs == 0) {
|
||||
virDomainSnapshotObjFree(snapshot);
|
||||
return 0;
|
||||
}
|
||||
return snapshot->refs;
|
||||
}
|
||||
|
||||
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
|
||||
const virDomainSnapshotDefPtr def)
|
||||
{
|
||||
@ -8782,7 +8769,7 @@ virDomainSnapshotObjListDataFree(void *payload,
|
||||
{
|
||||
virDomainSnapshotObjPtr obj = payload;
|
||||
|
||||
virDomainSnapshotObjUnref(obj);
|
||||
virDomainSnapshotObjFree(obj);
|
||||
}
|
||||
|
||||
int virDomainSnapshotObjListInit(virDomainSnapshotObjListPtr snapshots)
|
||||
|
@ -998,8 +998,6 @@ struct _virDomainSnapshotDef {
|
||||
typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
|
||||
typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
|
||||
struct _virDomainSnapshotObj {
|
||||
int refs;
|
||||
|
||||
virDomainSnapshotDefPtr def;
|
||||
};
|
||||
|
||||
@ -1028,7 +1026,6 @@ virDomainSnapshotObjPtr virDomainSnapshotFindByName(const virDomainSnapshotObjLi
|
||||
const char *name);
|
||||
void virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
|
||||
virDomainSnapshotObjPtr snapshot);
|
||||
int virDomainSnapshotObjUnref(virDomainSnapshotObjPtr snapshot);
|
||||
int virDomainSnapshotHasChildren(virDomainSnapshotObjPtr snap,
|
||||
virDomainSnapshotObjListPtr snapshots);
|
||||
|
||||
|
@ -305,7 +305,6 @@ virDomainSnapshotHasChildren;
|
||||
virDomainSnapshotObjListGetNames;
|
||||
virDomainSnapshotObjListNum;
|
||||
virDomainSnapshotObjListRemove;
|
||||
virDomainSnapshotObjUnref;
|
||||
virDomainSoundDefFree;
|
||||
virDomainSoundModelTypeFromString;
|
||||
virDomainSoundModelTypeToString;
|
||||
|
Loading…
Reference in New Issue
Block a user