conf: moment: Export helpers to create the virDomainMoment wrapper

Export 'virDomainMomentObjNew' and 'virDomainMomentObjFree' and define
the latter as autoptr cleanup function for 'virDomainMomentObj'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2022-01-11 10:27:11 +01:00
parent 6e9fa631ef
commit 6ba3334222
3 changed files with 12 additions and 2 deletions

View File

@ -205,7 +205,7 @@ virDomainMomentMoveChildren(virDomainMomentObj *from,
}
static virDomainMomentObj *
virDomainMomentObj *
virDomainMomentObjNew(void)
{
virDomainMomentObj *moment;
@ -218,7 +218,7 @@ virDomainMomentObjNew(void)
}
static void
void
virDomainMomentObjFree(virDomainMomentObj *moment)
{
if (!moment)

View File

@ -50,6 +50,14 @@ struct _virDomainMomentObj {
virDomainMomentObj *first_child; /* NULL if no children */
};
virDomainMomentObj *
virDomainMomentObjNew(void);
void
virDomainMomentObjFree(virDomainMomentObj *moment);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainMomentObj, virDomainMomentObjFree);
int
virDomainMomentForEachChild(virDomainMomentObj *moment,
virHashIterator iter,

View File

@ -1175,6 +1175,8 @@ virDomainMomentDropParent;
virDomainMomentForEachChild;
virDomainMomentForEachDescendant;
virDomainMomentMoveChildren;
virDomainMomentObjFree;
virDomainMomentObjNew;
# conf/virdomainobjlist.h