snapshot: Rename virDomainSnapshotObjPtr

Now that the core of SnapshotObj is agnostic to snapshots and can be
shared with upcoming checkpoint code, it is time to rename the struct
and the functions specific to list operations. A later patch will
shuffle which file holds the common code. This is a fairly mechanical
patch.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Eric Blake 2019-03-21 23:45:25 -05:00
parent 1ab05da228
commit e055a816af
18 changed files with 251 additions and 251 deletions

View File

@ -431,7 +431,7 @@ virDomainSnapshotDefParseString(const char *xmlStr,
int int
virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def,
const unsigned char *domain_uuid, const unsigned char *domain_uuid,
virDomainSnapshotObjPtr other, virDomainMomentObjPtr other,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
unsigned int flags) unsigned int flags)
{ {
@ -911,7 +911,7 @@ virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def)
} }
bool bool
virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap) virDomainSnapshotIsExternal(virDomainMomentObjPtr snap)
{ {
virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(snap); virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(snap);
@ -922,13 +922,13 @@ int
virDomainSnapshotRedefinePrep(virDomainPtr domain, virDomainSnapshotRedefinePrep(virDomainPtr domain,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotDefPtr *defptr, virDomainSnapshotDefPtr *defptr,
virDomainSnapshotObjPtr *snap, virDomainMomentObjPtr *snap,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
bool *update_current, bool *update_current,
unsigned int flags) unsigned int flags)
{ {
virDomainSnapshotDefPtr def = *defptr; virDomainSnapshotDefPtr def = *defptr;
virDomainSnapshotObjPtr other; virDomainMomentObjPtr other;
virDomainSnapshotDefPtr otherdef; virDomainSnapshotDefPtr otherdef;
bool check_if_stolen; bool check_if_stolen;
@ -983,7 +983,7 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
/* Drop and rebuild the parent relationship, but keep all /* Drop and rebuild the parent relationship, but keep all
* child relations by reusing snap. */ * child relations by reusing snap. */
virDomainSnapshotDropParent(other); virDomainMomentDropParent(other);
virDomainSnapshotDefFree(otherdef); virDomainSnapshotDefFree(otherdef);
other->def = &(*defptr)->common; other->def = &(*defptr)->common;
*defptr = NULL; *defptr = NULL;

View File

@ -131,19 +131,19 @@ int virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapshot,
bool require_match); bool require_match);
bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def); bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def);
bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap); bool virDomainSnapshotIsExternal(virDomainMomentObjPtr snap);
int virDomainSnapshotRedefinePrep(virDomainPtr domain, int virDomainSnapshotRedefinePrep(virDomainPtr domain,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotDefPtr *def, virDomainSnapshotDefPtr *def,
virDomainSnapshotObjPtr *snap, virDomainMomentObjPtr *snap,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
bool *update_current, bool *update_current,
unsigned int flags); unsigned int flags);
int virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, int virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def,
const unsigned char *domain_uuid, const unsigned char *domain_uuid,
virDomainSnapshotObjPtr other, virDomainMomentObjPtr other,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
unsigned int flags); unsigned int flags);

View File

@ -220,6 +220,9 @@ typedef virDomainMemtune *virDomainMemtunePtr;
typedef struct _virDomainMomentDef virDomainMomentDef; typedef struct _virDomainMomentDef virDomainMomentDef;
typedef virDomainMomentDef *virDomainMomentDefPtr; typedef virDomainMomentDef *virDomainMomentDefPtr;
typedef struct _virDomainMomentObj virDomainMomentObj;
typedef virDomainMomentObj *virDomainMomentObjPtr;
typedef struct _virDomainNVRAMDef virDomainNVRAMDef; typedef struct _virDomainNVRAMDef virDomainNVRAMDef;
typedef virDomainNVRAMDef *virDomainNVRAMDefPtr; typedef virDomainNVRAMDef *virDomainNVRAMDefPtr;
@ -280,9 +283,6 @@ typedef virDomainSmartcardDef *virDomainSmartcardDefPtr;
typedef struct _virDomainSnapshotDef virDomainSnapshotDef; typedef struct _virDomainSnapshotDef virDomainSnapshotDef;
typedef virDomainSnapshotDef *virDomainSnapshotDefPtr; typedef virDomainSnapshotDef *virDomainSnapshotDefPtr;
typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
typedef struct _virDomainSnapshotObjList virDomainSnapshotObjList; typedef struct _virDomainSnapshotObjList virDomainSnapshotObjList;
typedef virDomainSnapshotObjList *virDomainSnapshotObjListPtr; typedef virDomainSnapshotObjList *virDomainSnapshotObjListPtr;

View File

@ -33,80 +33,80 @@
VIR_LOG_INIT("conf.virdomainsnapshotobj"); VIR_LOG_INIT("conf.virdomainsnapshotobj");
/* Run iter(data) on all direct children of snapshot, while ignoring all /* Run iter(data) on all direct children of moment, while ignoring all
* other entries in snapshots. Return the number of children * other entries in moments. Return the number of children
* visited. No particular ordering is guaranteed. */ * visited. No particular ordering is guaranteed. */
int int
virDomainSnapshotForEachChild(virDomainSnapshotObjPtr snapshot, virDomainMomentForEachChild(virDomainMomentObjPtr moment,
virHashIterator iter, virHashIterator iter,
void *data) void *data)
{ {
virDomainSnapshotObjPtr child = snapshot->first_child; virDomainMomentObjPtr child = moment->first_child;
while (child) { while (child) {
virDomainSnapshotObjPtr next = child->sibling; virDomainMomentObjPtr next = child->sibling;
(iter)(child, child->def->name, data); (iter)(child, child->def->name, data);
child = next; child = next;
} }
return snapshot->nchildren; return moment->nchildren;
} }
struct snapshot_act_on_descendant { struct moment_act_on_descendant {
int number; int number;
virHashIterator iter; virHashIterator iter;
void *data; void *data;
}; };
static int static int
virDomainSnapshotActOnDescendant(void *payload, virDomainMomentActOnDescendant(void *payload,
const void *name, const void *name,
void *data) void *data)
{ {
virDomainSnapshotObjPtr obj = payload; virDomainMomentObjPtr obj = payload;
struct snapshot_act_on_descendant *curr = data; struct moment_act_on_descendant *curr = data;
(curr->iter)(payload, name, curr->data); (curr->iter)(payload, name, curr->data);
curr->number += 1 + virDomainSnapshotForEachDescendant(obj, curr->number += 1 + virDomainMomentForEachDescendant(obj,
curr->iter, curr->iter,
curr->data); curr->data);
return 0; return 0;
} }
/* Run iter(data) on all descendants of snapshot, while ignoring all /* Run iter(data) on all descendants of moment, while ignoring all
* other entries in snapshots. Return the number of descendants * other entries in moments. Return the number of descendants
* visited. The visit is guaranteed to be topological, but no * visited. The visit is guaranteed to be topological, but no
* particular order between siblings is guaranteed. */ * particular order between siblings is guaranteed. */
int int
virDomainSnapshotForEachDescendant(virDomainSnapshotObjPtr snapshot, virDomainMomentForEachDescendant(virDomainMomentObjPtr moment,
virHashIterator iter, virHashIterator iter,
void *data) void *data)
{ {
struct snapshot_act_on_descendant act; struct moment_act_on_descendant act;
act.number = 0; act.number = 0;
act.iter = iter; act.iter = iter;
act.data = data; act.data = data;
virDomainSnapshotForEachChild(snapshot, virDomainMomentForEachChild(moment,
virDomainSnapshotActOnDescendant, &act); virDomainMomentActOnDescendant, &act);
return act.number; return act.number;
} }
/* Prepare to reparent or delete snapshot, by removing it from its /* Prepare to reparent or delete moment, by removing it from its
* current listed parent. Note that when bulk removing all children * current listed parent. Note that when bulk removing all children
* of a parent, it is faster to just 0 the count rather than calling * of a parent, it is faster to just 0 the count rather than calling
* this function on each child. */ * this function on each child. */
void void
virDomainSnapshotDropParent(virDomainSnapshotObjPtr snapshot) virDomainMomentDropParent(virDomainMomentObjPtr moment)
{ {
virDomainSnapshotObjPtr prev = NULL; virDomainMomentObjPtr prev = NULL;
virDomainSnapshotObjPtr curr = NULL; virDomainMomentObjPtr curr = NULL;
snapshot->parent->nchildren--; moment->parent->nchildren--;
curr = snapshot->parent->first_child; curr = moment->parent->first_child;
while (curr != snapshot) { while (curr != moment) {
if (!curr) { if (!curr) {
VIR_WARN("inconsistent snapshot relations"); VIR_WARN("inconsistent snapshot relations");
return; return;
@ -115,42 +115,42 @@ virDomainSnapshotDropParent(virDomainSnapshotObjPtr snapshot)
curr = curr->sibling; curr = curr->sibling;
} }
if (prev) if (prev)
prev->sibling = snapshot->sibling; prev->sibling = moment->sibling;
else else
snapshot->parent->first_child = snapshot->sibling; moment->parent->first_child = moment->sibling;
snapshot->parent = NULL; moment->parent = NULL;
snapshot->sibling = NULL; moment->sibling = NULL;
} }
/* Update @snapshot to no longer have children. */ /* Update @moment to no longer have children. */
void void
virDomainSnapshotDropChildren(virDomainSnapshotObjPtr snapshot) virDomainMomentDropChildren(virDomainMomentObjPtr moment)
{ {
snapshot->nchildren = 0; moment->nchildren = 0;
snapshot->first_child = NULL; moment->first_child = NULL;
} }
/* Add @snapshot to @parent's list of children. */ /* Add @moment to @parent's list of children. */
void void
virDomainSnapshotSetParent(virDomainSnapshotObjPtr snapshot, virDomainMomentSetParent(virDomainMomentObjPtr moment,
virDomainSnapshotObjPtr parent) virDomainMomentObjPtr parent)
{ {
snapshot->parent = parent; moment->parent = parent;
parent->nchildren++; parent->nchildren++;
snapshot->sibling = parent->first_child; moment->sibling = parent->first_child;
parent->first_child = snapshot; parent->first_child = moment;
} }
/* Take all children of @from and convert them into children of @to. */ /* Take all children of @from and convert them into children of @to. */
void void
virDomainSnapshotMoveChildren(virDomainSnapshotObjPtr from, virDomainMomentMoveChildren(virDomainMomentObjPtr from,
virDomainSnapshotObjPtr to) virDomainMomentObjPtr to)
{ {
virDomainSnapshotObjPtr child; virDomainMomentObjPtr child;
virDomainSnapshotObjPtr last; virDomainMomentObjPtr last;
if (!from->first_child) if (!from->first_child)
return; return;

View File

@ -27,29 +27,29 @@
# include "virconftypes.h" # include "virconftypes.h"
# include "virhash.h" # include "virhash.h"
struct _virDomainSnapshotObj { struct _virDomainMomentObj {
virDomainMomentDefPtr def; /* non-NULL except for metaroot */ virDomainMomentDefPtr def; /* non-NULL except for metaroot */
virDomainSnapshotObjPtr parent; /* non-NULL except for metaroot, before virDomainMomentObjPtr parent; /* non-NULL except for metaroot, before
virDomainSnapshotUpdateRelations, or virDomainSnapshotUpdateRelations, or
after virDomainSnapshotDropParent */ after virDomainMomentDropParent */
virDomainSnapshotObjPtr sibling; /* NULL if last child of parent */ virDomainMomentObjPtr sibling; /* NULL if last child of parent */
size_t nchildren; size_t nchildren;
virDomainSnapshotObjPtr first_child; /* NULL if no children */ virDomainMomentObjPtr first_child; /* NULL if no children */
}; };
int virDomainSnapshotForEachChild(virDomainSnapshotObjPtr snapshot, int virDomainMomentForEachChild(virDomainMomentObjPtr moment,
virHashIterator iter, virHashIterator iter,
void *data); void *data);
int virDomainSnapshotForEachDescendant(virDomainSnapshotObjPtr snapshot, int virDomainMomentForEachDescendant(virDomainMomentObjPtr moment,
virHashIterator iter, virHashIterator iter,
void *data); void *data);
void virDomainSnapshotDropParent(virDomainSnapshotObjPtr snapshot); void virDomainMomentDropParent(virDomainMomentObjPtr moment);
void virDomainSnapshotDropChildren(virDomainSnapshotObjPtr snapshot); void virDomainMomentDropChildren(virDomainMomentObjPtr moment);
void virDomainSnapshotMoveChildren(virDomainSnapshotObjPtr from, void virDomainMomentMoveChildren(virDomainMomentObjPtr from,
virDomainSnapshotObjPtr to); virDomainMomentObjPtr to);
void virDomainSnapshotSetParent(virDomainSnapshotObjPtr snapshot, void virDomainMomentSetParent(virDomainMomentObjPtr moment,
virDomainSnapshotObjPtr parent); virDomainMomentObjPtr parent);
#endif /* LIBVIRT_VIRDOMAINSNAPSHOTOBJ_H */ #endif /* LIBVIRT_VIRDOMAINSNAPSHOTOBJ_H */

View File

@ -35,12 +35,12 @@
VIR_LOG_INIT("conf.virdomainsnapshotobjlist"); VIR_LOG_INIT("conf.virdomainsnapshotobjlist");
struct _virDomainSnapshotObjList { struct _virDomainSnapshotObjList {
/* name string -> virDomainSnapshotObj mapping /* name string -> virDomainMomentObj mapping
* for O(1), lockless lookup-by-name */ * for O(1), lockless lookup-by-name */
virHashTable *objs; virHashTable *objs;
virDomainSnapshotObj metaroot; /* Special parent of all root snapshots */ virDomainMomentObj metaroot; /* Special parent of all root snapshots */
virDomainSnapshotObjPtr current; /* The current snapshot, if any */ virDomainMomentObjPtr current; /* The current snapshot, if any */
}; };
@ -64,7 +64,7 @@ virDomainSnapshotObjListParse(const char *xmlStr,
int n; int n;
size_t i; size_t i;
int keepBlanksDefault = xmlKeepBlanksDefault(0); int keepBlanksDefault = xmlKeepBlanksDefault(0);
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
VIR_AUTOFREE(xmlNodePtr *) nodes = NULL; VIR_AUTOFREE(xmlNodePtr *) nodes = NULL;
VIR_AUTOFREE(char *) current = NULL; VIR_AUTOFREE(char *) current = NULL;
@ -165,7 +165,7 @@ virDomainSnapshotFormatOne(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virDomainSnapshotObjPtr snap = payload; virDomainMomentObjPtr snap = payload;
struct virDomainSnapshotFormatData *data = opaque; struct virDomainSnapshotFormatData *data = opaque;
return virDomainSnapshotDefFormatInternal(data->buf, data->uuidstr, return virDomainSnapshotDefFormatInternal(data->buf, data->uuidstr,
virDomainSnapshotObjGetDef(snap), virDomainSnapshotObjGetDef(snap),
@ -211,9 +211,9 @@ virDomainSnapshotObjListFormat(virBufferPtr buf,
/* Snapshot Obj functions */ /* Snapshot Obj functions */
static virDomainSnapshotObjPtr virDomainSnapshotObjNew(void) static virDomainMomentObjPtr virDomainMomentObjNew(void)
{ {
virDomainSnapshotObjPtr snapshot; virDomainMomentObjPtr snapshot;
if (VIR_ALLOC(snapshot) < 0) if (VIR_ALLOC(snapshot) < 0)
return NULL; return NULL;
@ -223,7 +223,7 @@ static virDomainSnapshotObjPtr virDomainSnapshotObjNew(void)
return snapshot; return snapshot;
} }
static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr snapshot) static void virDomainMomentObjFree(virDomainMomentObjPtr snapshot)
{ {
if (!snapshot) if (!snapshot)
return; return;
@ -234,10 +234,10 @@ static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr snapshot)
VIR_FREE(snapshot); VIR_FREE(snapshot);
} }
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots, virDomainMomentObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotDefPtr def) virDomainSnapshotDefPtr def)
{ {
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
if (virHashLookup(snapshots->objs, def->common.name) != NULL) { if (virHashLookup(snapshots->objs, def->common.name) != NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
@ -246,7 +246,7 @@ virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s
return NULL; return NULL;
} }
if (!(snap = virDomainSnapshotObjNew())) if (!(snap = virDomainMomentObjNew()))
return NULL; return NULL;
if (virHashAddEntry(snapshots->objs, snap->def->name, snap) < 0) { if (virHashAddEntry(snapshots->objs, snap->def->name, snap) < 0) {
@ -260,7 +260,7 @@ virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s
/* Snapshot Obj List functions */ /* Snapshot Obj List functions */
static bool static bool
virDomainSnapshotFilter(virDomainSnapshotObjPtr obj, virDomainSnapshotFilter(virDomainMomentObjPtr obj,
unsigned int flags) unsigned int flags)
{ {
virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(obj); virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(obj);
@ -295,9 +295,9 @@ static void
virDomainSnapshotObjListDataFree(void *payload, virDomainSnapshotObjListDataFree(void *payload,
const void *name ATTRIBUTE_UNUSED) const void *name ATTRIBUTE_UNUSED)
{ {
virDomainSnapshotObjPtr obj = payload; virDomainMomentObjPtr obj = payload;
virDomainSnapshotObjFree(obj); virDomainMomentObjFree(obj);
} }
virDomainSnapshotObjListPtr virDomainSnapshotObjListPtr
@ -324,21 +324,21 @@ virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots)
} }
struct virDomainSnapshotNameData { struct virDomainMomentNameData {
char **const names; char **const names;
int maxnames; int maxnames;
unsigned int flags; unsigned int flags;
int count; int count;
bool error; bool error;
virDomainSnapshotObjListFilter filter; virDomainMomentObjListFilter filter;
}; };
static int virDomainSnapshotObjListCopyNames(void *payload, static int virDomainMomentObjListCopyNames(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *opaque) void *opaque)
{ {
virDomainSnapshotObjPtr obj = payload; virDomainMomentObjPtr obj = payload;
struct virDomainSnapshotNameData *data = opaque; struct virDomainMomentNameData *data = opaque;
if (data->error) if (data->error)
return 0; return 0;
@ -363,12 +363,12 @@ static int virDomainSnapshotObjListCopyNames(void *payload,
int int
virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots, virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from, virDomainMomentObjPtr from,
char **const names, char **const names,
int maxnames, int maxnames,
unsigned int flags) unsigned int flags)
{ {
struct virDomainSnapshotNameData data = { names, maxnames, flags, 0, struct virDomainMomentNameData data = { names, maxnames, flags, 0,
false, virDomainSnapshotFilter }; false, virDomainSnapshotFilter };
size_t i; size_t i;
@ -413,17 +413,17 @@ virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
* simpler full hashtable visit or counter will do. */ * simpler full hashtable visit or counter will do. */
if (from->def || (names && if (from->def || (names &&
(flags & VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL))) (flags & VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL)))
virDomainSnapshotForEachDescendant(from, virDomainMomentForEachDescendant(from,
virDomainSnapshotObjListCopyNames, virDomainMomentObjListCopyNames,
&data); &data);
else if (names || data.flags) else if (names || data.flags)
virHashForEach(snapshots->objs, virDomainSnapshotObjListCopyNames, virHashForEach(snapshots->objs, virDomainMomentObjListCopyNames,
&data); &data);
else else
data.count = virHashSize(snapshots->objs); data.count = virHashSize(snapshots->objs);
} else if (names || data.flags) { } else if (names || data.flags) {
virDomainSnapshotForEachChild(from, virDomainMomentForEachChild(from,
virDomainSnapshotObjListCopyNames, &data); virDomainMomentObjListCopyNames, &data);
} else { } else {
data.count = from->nchildren; data.count = from->nchildren;
} }
@ -439,13 +439,13 @@ virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
int int
virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots, virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from, virDomainMomentObjPtr from,
unsigned int flags) unsigned int flags)
{ {
return virDomainSnapshotObjListGetNames(snapshots, from, NULL, 0, flags); return virDomainSnapshotObjListGetNames(snapshots, from, NULL, 0, flags);
} }
virDomainSnapshotObjPtr virDomainMomentObjPtr
virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots, virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots,
const char *name) const char *name)
{ {
@ -462,7 +462,7 @@ virDomainSnapshotObjListSize(virDomainSnapshotObjListPtr snapshots)
/* Return the current snapshot, or NULL */ /* Return the current snapshot, or NULL */
virDomainSnapshotObjPtr virDomainMomentObjPtr
virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots) virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots)
{ {
return snapshots->current; return snapshots->current;
@ -491,7 +491,7 @@ virDomainSnapshotIsCurrentName(virDomainSnapshotObjListPtr snapshots,
/* Update the current snapshot, using NULL if no current remains */ /* Update the current snapshot, using NULL if no current remains */
void void
virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots, virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr snapshot) virDomainMomentObjPtr snapshot)
{ {
snapshots->current = snapshot; snapshots->current = snapshot;
} }
@ -500,7 +500,7 @@ virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots,
/* Remove snapshot from the list; return true if it was current */ /* Remove snapshot from the list; return true if it was current */
bool bool
virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots, virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr snapshot) virDomainMomentObjPtr snapshot)
{ {
bool ret = snapshots->current == snapshot; bool ret = snapshots->current == snapshot;
virHashRemoveEntry(snapshots->objs, snapshot->def->name); virHashRemoveEntry(snapshots->objs, snapshot->def->name);
@ -514,7 +514,7 @@ void
virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots) virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots)
{ {
virHashRemoveAll(snapshots->objs); virHashRemoveAll(snapshots->objs);
virDomainSnapshotDropChildren(&snapshots->metaroot); virDomainMomentDropChildren(&snapshots->metaroot);
} }
@ -533,19 +533,19 @@ virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots,
* wire up the hierarchical relations for the given snapshot. The error * wire up the hierarchical relations for the given snapshot. The error
* indicator gets set if a parent is missing or a requested parent would * indicator gets set if a parent is missing or a requested parent would
* cause a circular parent chain. */ * cause a circular parent chain. */
struct snapshot_set_relation { struct moment_set_relation {
virDomainSnapshotObjListPtr snapshots; virDomainSnapshotObjListPtr snapshots;
int err; int err;
}; };
static int static int
virDomainSnapshotSetRelations(void *payload, virDomainMomentSetRelations(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr obj = payload; virDomainMomentObjPtr obj = payload;
struct snapshot_set_relation *curr = data; struct moment_set_relation *curr = data;
virDomainSnapshotObjPtr tmp; virDomainMomentObjPtr tmp;
virDomainSnapshotObjPtr parent; virDomainMomentObjPtr parent;
parent = virDomainSnapshotFindByName(curr->snapshots, obj->def->parent); parent = virDomainSnapshotFindByName(curr->snapshots, obj->def->parent);
if (!parent) { if (!parent) {
@ -564,7 +564,7 @@ virDomainSnapshotSetRelations(void *payload,
tmp = tmp->parent; tmp = tmp->parent;
} }
} }
virDomainSnapshotSetParent(obj, parent); virDomainMomentSetParent(obj, parent);
return 0; return 0;
} }
@ -575,10 +575,10 @@ virDomainSnapshotSetRelations(void *payload,
int int
virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots) virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots)
{ {
struct snapshot_set_relation act = { snapshots, 0 }; struct moment_set_relation act = { snapshots, 0 };
virDomainSnapshotDropChildren(&snapshots->metaroot); virDomainMomentDropChildren(&snapshots->metaroot);
virHashForEach(snapshots->objs, virDomainSnapshotSetRelations, &act); virHashForEach(snapshots->objs, virDomainMomentSetRelations, &act);
if (act.err) if (act.err)
snapshots->current = NULL; snapshots->current = NULL;
return act.err; return act.err;
@ -587,7 +587,7 @@ virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots)
int int
virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots, virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from, virDomainMomentObjPtr from,
virDomainPtr dom, virDomainPtr dom,
virDomainSnapshotPtr **snaps, virDomainSnapshotPtr **snaps,
unsigned int flags) unsigned int flags)

View File

@ -27,8 +27,8 @@
# include "virdomainsnapshotobj.h" # include "virdomainsnapshotobj.h"
# include "virbuffer.h" # include "virbuffer.h"
/* Filter that returns true if a given snapshot matches the filter flags */ /* Filter that returns true if a given moment matches the filter flags */
typedef bool (*virDomainSnapshotObjListFilter)(virDomainSnapshotObjPtr obj, typedef bool (*virDomainMomentObjListFilter)(virDomainMomentObjPtr obj,
unsigned int flags); unsigned int flags);
virDomainSnapshotObjListPtr virDomainSnapshotObjListNew(void); virDomainSnapshotObjListPtr virDomainSnapshotObjListNew(void);
@ -47,27 +47,27 @@ int virDomainSnapshotObjListFormat(virBufferPtr buf,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
unsigned int flags); unsigned int flags);
virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots, virDomainMomentObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotDefPtr def); virDomainSnapshotDefPtr def);
int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots, int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from, virDomainMomentObjPtr from,
char **const names, int maxnames, char **const names, int maxnames,
unsigned int flags); unsigned int flags);
int virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots, int virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from, virDomainMomentObjPtr from,
unsigned int flags); unsigned int flags);
virDomainSnapshotObjPtr virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots, virDomainMomentObjPtr virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots,
const char *name); const char *name);
int virDomainSnapshotObjListSize(virDomainSnapshotObjListPtr snapshots); int virDomainSnapshotObjListSize(virDomainSnapshotObjListPtr snapshots);
virDomainSnapshotObjPtr virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots); virDomainMomentObjPtr virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots);
const char *virDomainSnapshotGetCurrentName(virDomainSnapshotObjListPtr snapshots); const char *virDomainSnapshotGetCurrentName(virDomainSnapshotObjListPtr snapshots);
bool virDomainSnapshotIsCurrentName(virDomainSnapshotObjListPtr snapshots, bool virDomainSnapshotIsCurrentName(virDomainSnapshotObjListPtr snapshots,
const char *name); const char *name);
void virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots, void virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr snapshot); virDomainMomentObjPtr snapshot);
bool virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots, bool virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr snapshot); virDomainMomentObjPtr snapshot);
void virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots); void virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots);
int virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots, int virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots,
virHashIterator iter, virHashIterator iter,
@ -98,14 +98,14 @@ int virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots);
VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION) VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION)
int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots, int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotObjPtr from, virDomainMomentObjPtr from,
virDomainPtr dom, virDomainPtr dom,
virDomainSnapshotPtr **snaps, virDomainSnapshotPtr **snaps,
unsigned int flags); unsigned int flags);
/* Access the snapshot-specific definition from a given list member. */ /* Access the snapshot-specific definition from a given list member. */
static inline virDomainSnapshotDefPtr static inline virDomainSnapshotDefPtr
virDomainSnapshotObjGetDef(virDomainSnapshotObjPtr obj) virDomainSnapshotObjGetDef(virDomainMomentObjPtr obj)
{ {
return (virDomainSnapshotDefPtr) obj->def; return (virDomainSnapshotDefPtr) obj->def;
} }

View File

@ -980,12 +980,12 @@ virDomainObjListRename;
# conf/virdomainsnapshotobj.h # conf/virdomainsnapshotobj.h
virDomainSnapshotDropChildren; virDomainMomentDropChildren;
virDomainSnapshotDropParent; virDomainMomentDropParent;
virDomainSnapshotForEachChild; virDomainMomentForEachChild;
virDomainSnapshotForEachDescendant; virDomainMomentForEachDescendant;
virDomainSnapshotMoveChildren; virDomainMomentMoveChildren;
virDomainSnapshotSetParent; virDomainMomentSetParent;
# conf/virdomainsnapshotobjlist.h # conf/virdomainsnapshotobjlist.h

View File

@ -10632,7 +10632,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
virSecurityManagerPtr secManager, virSecurityManagerPtr secManager,
virDomainObjPtr vm, virDomainObjPtr vm,
const char *migrateURI, const char *migrateURI,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
bool standalone, bool standalone,
bool enableFips, bool enableFips,

View File

@ -47,7 +47,7 @@ virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver,
virSecurityManagerPtr secManager, virSecurityManagerPtr secManager,
virDomainObjPtr vm, virDomainObjPtr vm,
const char *migrateURI, const char *migrateURI,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
bool standalone, bool standalone,
bool enableFips, bool enableFips,

View File

@ -8448,7 +8448,7 @@ qemuFindQemuImgBinary(virQEMUDriverPtr driver)
int int
qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virCapsPtr caps, virCapsPtr caps,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
const char *snapshotDir) const char *snapshotDir)
@ -8566,7 +8566,7 @@ qemuDomainSnapshotForEachQcow2Raw(virQEMUDriverPtr driver,
int int
qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver, qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
const char *op, const char *op,
bool try_all) bool try_all)
{ {
@ -8585,14 +8585,14 @@ qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
int int
qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
bool update_parent, bool update_parent,
bool metadata_only) bool metadata_only)
{ {
char *snapFile = NULL; char *snapFile = NULL;
int ret = -1; int ret = -1;
qemuDomainObjPrivatePtr priv; qemuDomainObjPrivatePtr priv;
virDomainSnapshotObjPtr parentsnap = NULL; virDomainMomentObjPtr parentsnap = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (!metadata_only) { if (!metadata_only) {
@ -8638,7 +8638,7 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
if (unlink(snapFile) < 0) if (unlink(snapFile) < 0)
VIR_WARN("Failed to unlink %s", snapFile); VIR_WARN("Failed to unlink %s", snapFile);
if (update_parent) if (update_parent)
virDomainSnapshotDropParent(snap); virDomainMomentDropParent(snap);
virDomainSnapshotObjListRemove(vm->snapshots, snap); virDomainSnapshotObjListRemove(vm->snapshots, snap);
ret = 0; ret = 0;
@ -8654,7 +8654,7 @@ int qemuDomainSnapshotDiscardAll(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr snap = payload; virDomainMomentObjPtr snap = payload;
virQEMUSnapRemovePtr curr = data; virQEMUSnapRemovePtr curr = data;
int err; int err;

View File

@ -681,20 +681,20 @@ int qemuDomainLogAppendMessage(virQEMUDriverPtr driver,
const char *qemuFindQemuImgBinary(virQEMUDriverPtr driver); const char *qemuFindQemuImgBinary(virQEMUDriverPtr driver);
int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virCapsPtr caps, virCapsPtr caps,
virDomainXMLOptionPtr xmlopt, virDomainXMLOptionPtr xmlopt,
const char *snapshotDir); const char *snapshotDir);
int qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver, int qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
const char *op, const char *op,
bool try_all); bool try_all);
int qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, int qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
bool update_current, bool update_current,
bool metadata_only); bool metadata_only);

View File

@ -198,11 +198,11 @@ qemuDomObjFromSnapshot(virDomainSnapshotPtr snapshot)
/* Looks up snapshot object from VM and name */ /* Looks up snapshot object from VM and name */
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
qemuSnapObjFromName(virDomainObjPtr vm, qemuSnapObjFromName(virDomainObjPtr vm,
const char *name) const char *name)
{ {
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
snap = virDomainSnapshotFindByName(vm->snapshots, name); snap = virDomainSnapshotFindByName(vm->snapshots, name);
if (!snap) if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
@ -214,7 +214,7 @@ qemuSnapObjFromName(virDomainObjPtr vm,
/* Looks up snapshot object from VM and snapshotPtr */ /* Looks up snapshot object from VM and snapshotPtr */
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
qemuSnapObjFromSnapshot(virDomainObjPtr vm, qemuSnapObjFromSnapshot(virDomainObjPtr vm,
virDomainSnapshotPtr snapshot) virDomainSnapshotPtr snapshot)
{ {
@ -417,8 +417,8 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
char *xmlStr; char *xmlStr;
char *fullpath; char *fullpath;
virDomainSnapshotDefPtr def = NULL; virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotObjPtr current = NULL; virDomainMomentObjPtr current = NULL;
bool cur; bool cur;
unsigned int flags = (VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE | unsigned int flags = (VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE |
VIR_DOMAIN_SNAPSHOT_PARSE_DISKS | VIR_DOMAIN_SNAPSHOT_PARSE_DISKS |
@ -2140,7 +2140,7 @@ qemuDomainSnapshotCountExternal(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr snap = payload; virDomainMomentObjPtr snap = payload;
int *count = data; int *count = data;
if (virDomainSnapshotIsExternal(snap)) if (virDomainSnapshotIsExternal(snap))
@ -14513,7 +14513,7 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
static int static int
qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver, qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap) virDomainMomentObjPtr snap)
{ {
return qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-c", false); return qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-c", false);
} }
@ -14523,7 +14523,7 @@ qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
static int static int
qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver, qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
bool reuse) bool reuse)
{ {
size_t i; size_t i;
@ -14630,7 +14630,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
static int static int
qemuDomainSnapshotCreateActiveInternal(virQEMUDriverPtr driver, qemuDomainSnapshotCreateActiveInternal(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
unsigned int flags) unsigned int flags)
{ {
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
@ -15176,7 +15176,7 @@ qemuDomainSnapshotDiskDataFree(qemuDomainSnapshotDiskDataPtr data,
static qemuDomainSnapshotDiskDataPtr static qemuDomainSnapshotDiskDataPtr
qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver, qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
bool reuse) bool reuse)
{ {
size_t i; size_t i;
@ -15333,7 +15333,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
static int static int
qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver, qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
unsigned int flags, unsigned int flags,
qemuDomainAsyncJob asyncJob) qemuDomainAsyncJob asyncJob)
{ {
@ -15462,7 +15462,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
static int static int
qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver, qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap, virDomainMomentObjPtr snap,
unsigned int flags) unsigned int flags)
{ {
virObjectEventPtr event; virObjectEventPtr event;
@ -15660,14 +15660,14 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
virQEMUDriverPtr driver = domain->conn->privateData; virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
char *xml = NULL; char *xml = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotDefPtr def = NULL; virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotObjPtr current = NULL; virDomainMomentObjPtr current = NULL;
bool update_current = true; bool update_current = true;
bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE;
unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS; unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS;
virDomainSnapshotObjPtr other = NULL; virDomainMomentObjPtr other = NULL;
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
bool align_match = true; bool align_match = true;
virQEMUDriverConfigPtr cfg = NULL; virQEMUDriverConfigPtr cfg = NULL;
@ -15931,7 +15931,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
} else { } else {
other = virDomainSnapshotFindByName(vm->snapshots, other = virDomainSnapshotFindByName(vm->snapshots,
snap->def->parent); snap->def->parent);
virDomainSnapshotSetParent(snap, other); virDomainMomentSetParent(snap, other);
} }
} else if (snap) { } else if (snap) {
virDomainSnapshotObjListRemove(vm->snapshots, snap); virDomainSnapshotObjListRemove(vm->snapshots, snap);
@ -16035,7 +16035,7 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
int n = -1; int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@ -16065,7 +16065,7 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
int n = -1; int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@ -16095,7 +16095,7 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
int n = -1; int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@ -16126,7 +16126,7 @@ qemuDomainSnapshotLookupByName(virDomainPtr domain,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -16176,7 +16176,7 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr parent = NULL; virDomainSnapshotPtr parent = NULL;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -16241,7 +16241,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
virQEMUDriverPtr driver = snapshot->domain->conn->privateData; virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
char *xml = NULL; char *xml = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN];
virCheckFlags(VIR_DOMAIN_SNAPSHOT_XML_SECURE, NULL); virCheckFlags(VIR_DOMAIN_SNAPSHOT_XML_SECURE, NULL);
@ -16273,7 +16273,7 @@ qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
int ret = -1; int ret = -1;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -16300,7 +16300,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
int ret = -1; int ret = -1;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -16328,7 +16328,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
static int static int
qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver, qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver,
virDomainObjPtr vm, virDomainObjPtr vm,
virDomainSnapshotObjPtr snap) virDomainMomentObjPtr snap)
{ {
/* Try all disks, but report failure if we skipped any. */ /* Try all disks, but report failure if we skipped any. */
int ret = qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-a", true); int ret = qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-a", true);
@ -16343,8 +16343,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
virQEMUDriverPtr driver = snapshot->domain->conn->privateData; virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
int ret = -1; int ret = -1;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotObjPtr current = NULL; virDomainMomentObjPtr current = NULL;
virDomainSnapshotDefPtr snapdef; virDomainSnapshotDefPtr snapdef;
virObjectEventPtr event = NULL; virObjectEventPtr event = NULL;
virObjectEventPtr event2 = NULL; virObjectEventPtr event2 = NULL;
@ -16762,7 +16762,7 @@ typedef struct _virQEMUSnapReparent virQEMUSnapReparent;
typedef virQEMUSnapReparent *virQEMUSnapReparentPtr; typedef virQEMUSnapReparent *virQEMUSnapReparentPtr;
struct _virQEMUSnapReparent { struct _virQEMUSnapReparent {
virQEMUDriverConfigPtr cfg; virQEMUDriverConfigPtr cfg;
virDomainSnapshotObjPtr parent; virDomainMomentObjPtr parent;
virDomainObjPtr vm; virDomainObjPtr vm;
virCapsPtr caps; virCapsPtr caps;
virDomainXMLOptionPtr xmlopt; virDomainXMLOptionPtr xmlopt;
@ -16775,7 +16775,7 @@ qemuDomainSnapshotReparentChildren(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr snap = payload; virDomainMomentObjPtr snap = payload;
virQEMUSnapReparentPtr rep = data; virQEMUSnapReparentPtr rep = data;
if (rep->err < 0) if (rep->err < 0)
@ -16803,7 +16803,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
virQEMUDriverPtr driver = snapshot->domain->conn->privateData; virQEMUDriverPtr driver = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
int ret = -1; int ret = -1;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virQEMUSnapRemove rem; virQEMUSnapRemove rem;
virQEMUSnapReparent rep; virQEMUSnapReparent rep;
bool metadata_only = !!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY); bool metadata_only = !!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY);
@ -16834,7 +16834,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
external++; external++;
if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN | if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY)) VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY))
virDomainSnapshotForEachDescendant(snap, virDomainMomentForEachDescendant(snap,
qemuDomainSnapshotCountExternal, qemuDomainSnapshotCountExternal,
&external); &external);
if (external) { if (external) {
@ -16852,7 +16852,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
rem.metadata_only = metadata_only; rem.metadata_only = metadata_only;
rem.err = 0; rem.err = 0;
rem.current = false; rem.current = false;
virDomainSnapshotForEachDescendant(snap, virDomainMomentForEachDescendant(snap,
qemuDomainSnapshotDiscardAll, qemuDomainSnapshotDiscardAll,
&rem); &rem);
if (rem.err < 0) if (rem.err < 0)
@ -16878,16 +16878,16 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
rep.err = 0; rep.err = 0;
rep.caps = driver->caps; rep.caps = driver->caps;
rep.xmlopt = driver->xmlopt; rep.xmlopt = driver->xmlopt;
virDomainSnapshotForEachChild(snap, virDomainMomentForEachChild(snap,
qemuDomainSnapshotReparentChildren, qemuDomainSnapshotReparentChildren,
&rep); &rep);
if (rep.err < 0) if (rep.err < 0)
goto endjob; goto endjob;
virDomainSnapshotMoveChildren(snap, snap->parent); virDomainMomentMoveChildren(snap, snap->parent);
} }
if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) { if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) {
virDomainSnapshotDropChildren(snap); virDomainMomentDropChildren(snap);
ret = 0; ret = 0;
} else { } else {
ret = qemuDomainSnapshotDiscard(driver, vm, snap, true, metadata_only); ret = qemuDomainSnapshotDiscard(driver, vm, snap, true, metadata_only);

View File

@ -6469,7 +6469,7 @@ qemuProcessLaunch(virConnectPtr conn,
virDomainObjPtr vm, virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob, qemuDomainAsyncJob asyncJob,
qemuProcessIncomingDefPtr incoming, qemuProcessIncomingDefPtr incoming,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
unsigned int flags) unsigned int flags)
{ {
@ -6882,7 +6882,7 @@ qemuProcessStart(virConnectPtr conn,
const char *migrateFrom, const char *migrateFrom,
int migrateFd, int migrateFd,
const char *migratePath, const char *migratePath,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
unsigned int flags) unsigned int flags)
{ {

View File

@ -92,7 +92,7 @@ int qemuProcessStart(virConnectPtr conn,
const char *migrateFrom, const char *migrateFrom,
int stdin_fd, int stdin_fd,
const char *stdin_path, const char *stdin_path,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
unsigned int flags); unsigned int flags);
@ -125,7 +125,7 @@ int qemuProcessLaunch(virConnectPtr conn,
virDomainObjPtr vm, virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob, qemuDomainAsyncJob asyncJob,
qemuProcessIncomingDefPtr incoming, qemuProcessIncomingDefPtr incoming,
virDomainSnapshotObjPtr snapshot, virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop, virNetDevVPortProfileOp vmop,
unsigned int flags); unsigned int flags);

View File

@ -822,7 +822,7 @@ testParseDomainSnapshots(testDriverPtr privconn,
bool cur; bool cur;
for (i = 0; i < nsdata->num_snap_nodes; i++) { for (i = 0; i < nsdata->num_snap_nodes; i++) {
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotDefPtr def; virDomainSnapshotDefPtr def;
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
"domainsnapshot"); "domainsnapshot");
@ -5946,11 +5946,11 @@ testDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
* Snapshot APIs * Snapshot APIs
*/ */
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
testSnapObjFromName(virDomainObjPtr vm, testSnapObjFromName(virDomainObjPtr vm,
const char *name) const char *name)
{ {
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
snap = virDomainSnapshotFindByName(vm->snapshots, name); snap = virDomainSnapshotFindByName(vm->snapshots, name);
if (!snap) if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
@ -5959,7 +5959,7 @@ testSnapObjFromName(virDomainObjPtr vm,
return snap; return snap;
} }
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
testSnapObjFromSnapshot(virDomainObjPtr vm, testSnapObjFromSnapshot(virDomainObjPtr vm,
virDomainSnapshotPtr snapshot) virDomainSnapshotPtr snapshot)
{ {
@ -6042,7 +6042,7 @@ testDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
int n = -1; int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@ -6068,7 +6068,7 @@ testDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
int n = -1; int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@ -6094,7 +6094,7 @@ testDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
int n = -1; int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@ -6121,7 +6121,7 @@ testDomainSnapshotLookupByName(virDomainPtr domain,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -6162,7 +6162,7 @@ testDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr parent = NULL; virDomainSnapshotPtr parent = NULL;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -6193,7 +6193,7 @@ testDomainSnapshotCurrent(virDomainPtr domain,
{ {
virDomainObjPtr vm; virDomainObjPtr vm;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotObjPtr current; virDomainMomentObjPtr current;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -6220,7 +6220,7 @@ testDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
char *xml = NULL; char *xml = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN];
testDriverPtr privconn = snapshot->domain->conn->privateData; testDriverPtr privconn = snapshot->domain->conn->privateData;
@ -6322,7 +6322,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
testDriverPtr privconn = domain->conn->privateData; testDriverPtr privconn = domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotDefPtr def = NULL; virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virObjectEventPtr event = NULL; virObjectEventPtr event = NULL;
bool update_current = true; bool update_current = true;
@ -6411,12 +6411,12 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
cleanup: cleanup:
if (vm) { if (vm) {
if (snapshot) { if (snapshot) {
virDomainSnapshotObjPtr other; virDomainMomentObjPtr other;
if (update_current) if (update_current)
virDomainSnapshotSetCurrent(vm->snapshots, snap); virDomainSnapshotSetCurrent(vm->snapshots, snap);
other = virDomainSnapshotFindByName(vm->snapshots, other = virDomainSnapshotFindByName(vm->snapshots,
snap->def->parent); snap->def->parent);
virDomainSnapshotSetParent(snap, other); virDomainMomentSetParent(snap, other);
} }
virDomainObjEndAPI(&vm); virDomainObjEndAPI(&vm);
} }
@ -6438,7 +6438,7 @@ testDomainSnapshotDiscardAll(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr snap = payload; virDomainMomentObjPtr snap = payload;
testSnapRemoveDataPtr curr = data; testSnapRemoveDataPtr curr = data;
curr->current |= virDomainSnapshotObjListRemove(curr->vm->snapshots, snap); curr->current |= virDomainSnapshotObjListRemove(curr->vm->snapshots, snap);
@ -6448,7 +6448,7 @@ testDomainSnapshotDiscardAll(void *payload,
typedef struct _testSnapReparentData testSnapReparentData; typedef struct _testSnapReparentData testSnapReparentData;
typedef testSnapReparentData *testSnapReparentDataPtr; typedef testSnapReparentData *testSnapReparentDataPtr;
struct _testSnapReparentData { struct _testSnapReparentData {
virDomainSnapshotObjPtr parent; virDomainMomentObjPtr parent;
virDomainObjPtr vm; virDomainObjPtr vm;
int err; int err;
}; };
@ -6458,7 +6458,7 @@ testDomainSnapshotReparentChildren(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr snap = payload; virDomainMomentObjPtr snap = payload;
testSnapReparentDataPtr rep = data; testSnapReparentDataPtr rep = data;
if (rep->err < 0) if (rep->err < 0)
@ -6480,8 +6480,8 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virDomainSnapshotObjPtr parentsnap = NULL; virDomainMomentObjPtr parentsnap = NULL;
int ret = -1; int ret = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN | virCheckFlags(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
@ -6498,7 +6498,7 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
testSnapRemoveData rem; testSnapRemoveData rem;
rem.vm = vm; rem.vm = vm;
rem.current = false; rem.current = false;
virDomainSnapshotForEachDescendant(snap, virDomainMomentForEachDescendant(snap,
testDomainSnapshotDiscardAll, testDomainSnapshotDiscardAll,
&rem); &rem);
if (rem.current) if (rem.current)
@ -6508,19 +6508,19 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
rep.parent = snap->parent; rep.parent = snap->parent;
rep.vm = vm; rep.vm = vm;
rep.err = 0; rep.err = 0;
virDomainSnapshotForEachChild(snap, virDomainMomentForEachChild(snap,
testDomainSnapshotReparentChildren, testDomainSnapshotReparentChildren,
&rep); &rep);
if (rep.err < 0) if (rep.err < 0)
goto cleanup; goto cleanup;
virDomainSnapshotMoveChildren(snap, snap->parent); virDomainMomentMoveChildren(snap, snap->parent);
} }
if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) { if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) {
virDomainSnapshotDropChildren(snap); virDomainMomentDropChildren(snap);
} else { } else {
virDomainSnapshotDropParent(snap); virDomainMomentDropParent(snap);
if (snap == virDomainSnapshotGetCurrent(vm->snapshots)) { if (snap == virDomainSnapshotGetCurrent(vm->snapshots)) {
if (snap->def->parent) { if (snap->def->parent) {
parentsnap = virDomainSnapshotFindByName(vm->snapshots, parentsnap = virDomainSnapshotFindByName(vm->snapshots,
@ -6546,7 +6546,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
{ {
testDriverPtr privconn = snapshot->domain->conn->privateData; testDriverPtr privconn = snapshot->domain->conn->privateData;
virDomainObjPtr vm = NULL; virDomainObjPtr vm = NULL;
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
virObjectEventPtr event = NULL; virObjectEventPtr event = NULL;
virObjectEventPtr event2 = NULL; virObjectEventPtr event2 = NULL;
virDomainDefPtr config = NULL; virDomainDefPtr config = NULL;

View File

@ -2132,10 +2132,10 @@ static int vzDomainSetMemory(virDomainPtr domain, unsigned long memory)
return ret; return ret;
} }
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char *name) vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char *name)
{ {
virDomainSnapshotObjPtr snap = NULL; virDomainMomentObjPtr snap = NULL;
snap = virDomainSnapshotFindByName(snapshots, name); snap = virDomainSnapshotFindByName(snapshots, name);
if (!snap) if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
@ -2144,7 +2144,7 @@ vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char *name)
return snap; return snap;
} }
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr snapshots, vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotPtr snapshot) virDomainSnapshotPtr snapshot)
{ {
@ -2156,8 +2156,8 @@ vzCurrentSnapshotIterator(void *payload,
const void *name ATTRIBUTE_UNUSED, const void *name ATTRIBUTE_UNUSED,
void *data) void *data)
{ {
virDomainSnapshotObjPtr snapshot = payload; virDomainMomentObjPtr snapshot = payload;
virDomainSnapshotObjPtr *current = data; virDomainMomentObjPtr *current = data;
if (snapshot->def->current) if (snapshot->def->current)
*current = snapshot; *current = snapshot;
@ -2165,10 +2165,10 @@ vzCurrentSnapshotIterator(void *payload,
return 0; return 0;
} }
static virDomainSnapshotObjPtr static virDomainMomentObjPtr
vzFindCurrentSnapshot(virDomainSnapshotObjListPtr snapshots) vzFindCurrentSnapshot(virDomainSnapshotObjListPtr snapshots)
{ {
virDomainSnapshotObjPtr current = NULL; virDomainMomentObjPtr current = NULL;
virDomainSnapshotForEach(snapshots, vzCurrentSnapshotIterator, &current); virDomainSnapshotForEach(snapshots, vzCurrentSnapshotIterator, &current);
return current; return current;
@ -2268,7 +2268,7 @@ vzDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags)
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
char *xml = NULL; char *xml = NULL;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
char uuidstr[VIR_UUID_STRING_BUFLEN]; char uuidstr[VIR_UUID_STRING_BUFLEN];
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
vzConnPtr privconn = snapshot->domain->conn->privateData; vzConnPtr privconn = snapshot->domain->conn->privateData;
@ -2304,7 +2304,7 @@ static int
vzDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, unsigned int flags) vzDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, unsigned int flags)
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
int n = -1; int n = -1;
@ -2339,7 +2339,7 @@ vzDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
int n = -1; int n = -1;
@ -2373,7 +2373,7 @@ vzDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
int n = -1; int n = -1;
@ -2407,7 +2407,7 @@ vzDomainSnapshotLookupByName(virDomainPtr domain,
unsigned int flags) unsigned int flags)
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
@ -2465,7 +2465,7 @@ static virDomainSnapshotPtr
vzDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags) vzDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags)
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotPtr parent = NULL; virDomainSnapshotPtr parent = NULL;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
@ -2505,7 +2505,7 @@ vzDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags)
virDomainObjPtr dom; virDomainObjPtr dom;
virDomainSnapshotPtr snapshot = NULL; virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
virDomainSnapshotObjPtr current; virDomainMomentObjPtr current;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);
@ -2539,7 +2539,7 @@ vzDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned int flags)
virDomainObjPtr dom; virDomainObjPtr dom;
int ret = -1; int ret = -1;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
virDomainSnapshotObjPtr current; virDomainMomentObjPtr current;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -2568,7 +2568,7 @@ vzDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
{ {
virDomainObjPtr dom; virDomainObjPtr dom;
int ret = -1; int ret = -1;
virDomainSnapshotObjPtr snap; virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
virCheckFlags(0, -1); virCheckFlags(0, -1);
@ -2606,7 +2606,7 @@ vzDomainSnapshotCreateXML(virDomainPtr domain,
vzDriverPtr driver = privconn->driver; vzDriverPtr driver = privconn->driver;
unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS; unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
virDomainSnapshotObjPtr current; virDomainMomentObjPtr current;
bool job = false; bool job = false;
virCheckFlags(0, NULL); virCheckFlags(0, NULL);

View File

@ -4655,8 +4655,8 @@ prlsdkParseSnapshotTree(const char *treexml)
xmlNodePtr root; xmlNodePtr root;
xmlNodePtr *nodes = NULL; xmlNodePtr *nodes = NULL;
virDomainSnapshotDefPtr def = NULL; virDomainSnapshotDefPtr def = NULL;
virDomainSnapshotObjPtr snapshot; virDomainMomentObjPtr snapshot;
virDomainSnapshotObjPtr current = NULL; virDomainMomentObjPtr current = NULL;
virDomainSnapshotObjListPtr snapshots = NULL; virDomainSnapshotObjListPtr snapshots = NULL;
char *xmlstr = NULL; char *xmlstr = NULL;
int n; int n;