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(a)redhat.com>
---
src/conf/snapshot_conf.h | 6 +-
src/conf/virconftypes.h | 6 +-
src/conf/virdomainsnapshotobj.h | 38 +++++------
src/conf/virdomainsnapshotobjlist.h | 26 ++++----
src/qemu/qemu_command.h | 2 +-
src/qemu/qemu_domain.h | 6 +-
src/qemu/qemu_process.h | 4 +-
src/conf/snapshot_conf.c | 10 +--
src/conf/virdomainsnapshotobj.c | 96 +++++++++++++-------------
src/conf/virdomainsnapshotobjlist.c | 100 ++++++++++++++--------------
src/libvirt_private.syms | 12 ++--
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain.c | 12 ++--
src/qemu/qemu_driver.c | 82 +++++++++++------------
src/qemu/qemu_process.c | 4 +-
src/test/test_driver.c | 58 ++++++++--------
src/vz/vz_driver.c | 34 +++++-----
src/vz/vz_sdk.c | 4 +-
18 files changed, 251 insertions(+), 251 deletions(-)
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
index 4b777e94dc..20487454c9 100644
--- a/src/conf/snapshot_conf.h
+++ b/src/conf/snapshot_conf.h
@@ -154,19 +154,19 @@ int virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapshot,
VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION)
bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def);
-bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap);
+bool virDomainSnapshotIsExternal(virDomainMomentObjPtr snap);
int virDomainSnapshotRedefinePrep(virDomainPtr domain,
virDomainObjPtr vm,
virDomainSnapshotDefPtr *def,
- virDomainSnapshotObjPtr *snap,
+ virDomainMomentObjPtr *snap,
virDomainXMLOptionPtr xmlopt,
bool *update_current,
unsigned int flags);
int virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def,
const unsigned char *domain_uuid,
- virDomainSnapshotObjPtr other,
+ virDomainMomentObjPtr other,
virDomainXMLOptionPtr xmlopt,
unsigned int flags);
diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h
index 9b9ab314e7..574815cf04 100644
--- a/src/conf/virconftypes.h
+++ b/src/conf/virconftypes.h
@@ -220,6 +220,9 @@ typedef virDomainMemtune *virDomainMemtunePtr;
typedef struct _virDomainMomentDef virDomainMomentDef;
typedef virDomainMomentDef *virDomainMomentDefPtr;
+typedef struct _virDomainMomentObj virDomainMomentObj;
+typedef virDomainMomentObj *virDomainMomentObjPtr;
+
typedef struct _virDomainNVRAMDef virDomainNVRAMDef;
typedef virDomainNVRAMDef *virDomainNVRAMDefPtr;
@@ -280,9 +283,6 @@ typedef virDomainSmartcardDef *virDomainSmartcardDefPtr;
typedef struct _virDomainSnapshotDef virDomainSnapshotDef;
typedef virDomainSnapshotDef *virDomainSnapshotDefPtr;
-typedef struct _virDomainSnapshotObj virDomainSnapshotObj;
-typedef virDomainSnapshotObj *virDomainSnapshotObjPtr;
-
typedef struct _virDomainSnapshotObjList virDomainSnapshotObjList;
typedef virDomainSnapshotObjList *virDomainSnapshotObjListPtr;
diff --git a/src/conf/virdomainsnapshotobj.h b/src/conf/virdomainsnapshotobj.h
index ed2884e976..86c5f6860b 100644
--- a/src/conf/virdomainsnapshotobj.h
+++ b/src/conf/virdomainsnapshotobj.h
@@ -27,33 +27,33 @@
# include "virconftypes.h"
# include "virhash.h"
-struct _virDomainSnapshotObj {
+struct _virDomainMomentObj {
virDomainMomentDefPtr def; /* non-NULL except for metaroot */
- virDomainSnapshotObjPtr parent; /* non-NULL except for metaroot, before
- virDomainSnapshotUpdateRelations, or
- after virDomainSnapshotDropParent */
- virDomainSnapshotObjPtr sibling; /* NULL if last child of parent */
+ virDomainMomentObjPtr parent; /* non-NULL except for metaroot, before
+ virDomainSnapshotUpdateRelations, or
+ after virDomainMomentDropParent */
+ virDomainMomentObjPtr sibling; /* NULL if last child of parent */
size_t nchildren;
- virDomainSnapshotObjPtr first_child; /* NULL if no children */
+ virDomainMomentObjPtr first_child; /* NULL if no children */
};
-int virDomainSnapshotForEachChild(virDomainSnapshotObjPtr snapshot,
- virHashIterator iter,
- void *data);
-int virDomainSnapshotForEachDescendant(virDomainSnapshotObjPtr snapshot,
- virHashIterator iter,
- void *data);
-void virDomainSnapshotDropParent(virDomainSnapshotObjPtr snapshot);
-void virDomainSnapshotDropChildren(virDomainSnapshotObjPtr snapshot);
-void virDomainSnapshotMoveChildren(virDomainSnapshotObjPtr from,
- virDomainSnapshotObjPtr to);
-void virDomainSnapshotSetParent(virDomainSnapshotObjPtr snapshot,
- virDomainSnapshotObjPtr parent);
+int virDomainMomentForEachChild(virDomainMomentObjPtr moment,
+ virHashIterator iter,
+ void *data);
+int virDomainMomentForEachDescendant(virDomainMomentObjPtr moment,
+ virHashIterator iter,
+ void *data);
+void virDomainMomentDropParent(virDomainMomentObjPtr moment);
+void virDomainMomentDropChildren(virDomainMomentObjPtr moment);
+void virDomainMomentMoveChildren(virDomainMomentObjPtr from,
+ virDomainMomentObjPtr to);
+void virDomainMomentSetParent(virDomainMomentObjPtr moment,
+ virDomainMomentObjPtr parent);
static inline virDomainSnapshotDefPtr
-virDomainSnapshotObjGetDef(virDomainSnapshotObjPtr obj)
+virDomainSnapshotObjGetDef(virDomainMomentObjPtr obj)
{
return (virDomainSnapshotDefPtr) obj->def;
}
diff --git a/src/conf/virdomainsnapshotobjlist.h b/src/conf/virdomainsnapshotobjlist.h
index c7d4d265cb..1af367639d 100644
--- a/src/conf/virdomainsnapshotobjlist.h
+++ b/src/conf/virdomainsnapshotobjlist.h
@@ -27,9 +27,9 @@
# include "virdomainsnapshotobj.h"
# include "virbuffer.h"
-/* Filter that returns true if a given snapshot matches the filter flags */
-typedef bool (*virDomainSnapshotObjListFilter)(virDomainSnapshotObjPtr obj,
- unsigned int flags);
+/* Filter that returns true if a given moment matches the filter flags */
+typedef bool (*virDomainMomentObjListFilter)(virDomainMomentObjPtr obj,
+ unsigned int flags);
virDomainSnapshotObjListPtr virDomainSnapshotObjListNew(void);
void virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots);
@@ -47,27 +47,27 @@ int virDomainSnapshotObjListFormat(virBufferPtr buf,
virDomainXMLOptionPtr xmlopt,
unsigned int flags);
-virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr
snapshots,
- virDomainSnapshotDefPtr def);
+virDomainMomentObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
+ virDomainSnapshotDefPtr def);
int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr from,
+ virDomainMomentObjPtr from,
char **const names, int maxnames,
unsigned int flags);
int virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr from,
+ virDomainMomentObjPtr from,
unsigned int flags);
-virDomainSnapshotObjPtr virDomainSnapshotFindByName(virDomainSnapshotObjListPtr
snapshots,
- const char *name);
+virDomainMomentObjPtr virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots,
+ const char *name);
int virDomainSnapshotObjListSize(virDomainSnapshotObjListPtr snapshots);
-virDomainSnapshotObjPtr virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr
snapshots);
+virDomainMomentObjPtr virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr
snapshots);
const char *virDomainSnapshotGetCurrentName(virDomainSnapshotObjListPtr snapshots);
bool virDomainSnapshotIsCurrentName(virDomainSnapshotObjListPtr snapshots,
const char *name);
void virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr snapshot);
+ virDomainMomentObjPtr snapshot);
bool virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr snapshot);
+ virDomainMomentObjPtr snapshot);
void virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots);
int virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots,
virHashIterator iter,
@@ -75,7 +75,7 @@ int virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots,
int virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots);
int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr from,
+ virDomainMomentObjPtr from,
virDomainPtr dom,
virDomainSnapshotPtr **snaps,
unsigned int flags);
diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h
index 077484094d..77578155e6 100644
--- a/src/qemu/qemu_command.h
+++ b/src/qemu/qemu_command.h
@@ -47,7 +47,7 @@ virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver,
virSecurityManagerPtr secManager,
virDomainObjPtr vm,
const char *migrateURI,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop,
bool standalone,
bool enableFips,
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index fb361515ba..ca24de15e5 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -681,20 +681,20 @@ int qemuDomainLogAppendMessage(virQEMUDriverPtr driver,
const char *qemuFindQemuImgBinary(virQEMUDriverPtr driver);
int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
const char *snapshotDir);
int qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
const char *op,
bool try_all);
int qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
bool update_current,
bool metadata_only);
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
index 3367cd3fe5..d20bd5306e 100644
--- a/src/qemu/qemu_process.h
+++ b/src/qemu/qemu_process.h
@@ -92,7 +92,7 @@ int qemuProcessStart(virConnectPtr conn,
const char *migrateFrom,
int stdin_fd,
const char *stdin_path,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop,
unsigned int flags);
@@ -125,7 +125,7 @@ int qemuProcessLaunch(virConnectPtr conn,
virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob,
qemuProcessIncomingDefPtr incoming,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop,
unsigned int flags);
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
index b80b199ce4..938b69cf60 100644
--- a/src/conf/snapshot_conf.c
+++ b/src/conf/snapshot_conf.c
@@ -426,7 +426,7 @@ virDomainSnapshotDefParseString(const char *xmlStr,
int
virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def,
const unsigned char *domain_uuid,
- virDomainSnapshotObjPtr other,
+ virDomainMomentObjPtr other,
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
@@ -907,7 +907,7 @@ virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def)
}
bool
-virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
+virDomainSnapshotIsExternal(virDomainMomentObjPtr snap)
{
virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(snap);
@@ -918,13 +918,13 @@ int
virDomainSnapshotRedefinePrep(virDomainPtr domain,
virDomainObjPtr vm,
virDomainSnapshotDefPtr *defptr,
- virDomainSnapshotObjPtr *snap,
+ virDomainMomentObjPtr *snap,
virDomainXMLOptionPtr xmlopt,
bool *update_current,
unsigned int flags)
{
virDomainSnapshotDefPtr def = *defptr;
- virDomainSnapshotObjPtr other;
+ virDomainMomentObjPtr other;
virDomainSnapshotDefPtr otherdef;
bool check_if_stolen;
@@ -981,7 +981,7 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
/* Drop and rebuild the parent relationship, but keep all
* child relations by reusing snap. */
- virDomainSnapshotDropParent(other);
+ virDomainMomentDropParent(other);
virDomainSnapshotDefFree(otherdef);
otherdef = def;
*defptr = NULL;
diff --git a/src/conf/virdomainsnapshotobj.c b/src/conf/virdomainsnapshotobj.c
index d6b216c7b2..877a0a9079 100644
--- a/src/conf/virdomainsnapshotobj.c
+++ b/src/conf/virdomainsnapshotobj.c
@@ -33,80 +33,80 @@
VIR_LOG_INIT("conf.virdomainsnapshotobj");
-/* Run iter(data) on all direct children of snapshot, while ignoring all
- * other entries in snapshots. Return the number of children
+/* Run iter(data) on all direct children of moment, while ignoring all
+ * other entries in moments. Return the number of children
* visited. No particular ordering is guaranteed. */
int
-virDomainSnapshotForEachChild(virDomainSnapshotObjPtr snapshot,
- virHashIterator iter,
- void *data)
+virDomainMomentForEachChild(virDomainMomentObjPtr moment,
+ virHashIterator iter,
+ void *data)
{
- virDomainSnapshotObjPtr child = snapshot->first_child;
+ virDomainMomentObjPtr child = moment->first_child;
while (child) {
- virDomainSnapshotObjPtr next = child->sibling;
+ virDomainMomentObjPtr next = child->sibling;
(iter)(child, child->def->name, data);
child = next;
}
- return snapshot->nchildren;
+ return moment->nchildren;
}
-struct snapshot_act_on_descendant {
+struct moment_act_on_descendant {
int number;
virHashIterator iter;
void *data;
};
static int
-virDomainSnapshotActOnDescendant(void *payload,
- const void *name,
- void *data)
+virDomainMomentActOnDescendant(void *payload,
+ const void *name,
+ void *data)
{
- virDomainSnapshotObjPtr obj = payload;
- struct snapshot_act_on_descendant *curr = data;
+ virDomainMomentObjPtr obj = payload;
+ struct moment_act_on_descendant *curr = data;
(curr->iter)(payload, name, curr->data);
- curr->number += 1 + virDomainSnapshotForEachDescendant(obj,
+ curr->number += 1 + virDomainMomentForEachDescendant(obj,
curr->iter,
curr->data);
return 0;
}
-/* Run iter(data) on all descendants of snapshot, while ignoring all
- * other entries in snapshots. Return the number of descendants
+/* Run iter(data) on all descendants of moment, while ignoring all
+ * other entries in moments. Return the number of descendants
* visited. The visit is guaranteed to be topological, but no
* particular order between siblings is guaranteed. */
int
-virDomainSnapshotForEachDescendant(virDomainSnapshotObjPtr snapshot,
- virHashIterator iter,
- void *data)
+virDomainMomentForEachDescendant(virDomainMomentObjPtr moment,
+ virHashIterator iter,
+ void *data)
{
- struct snapshot_act_on_descendant act;
+ struct moment_act_on_descendant act;
act.number = 0;
act.iter = iter;
act.data = data;
- virDomainSnapshotForEachChild(snapshot,
- virDomainSnapshotActOnDescendant, &act);
+ virDomainMomentForEachChild(moment,
+ virDomainMomentActOnDescendant, &act);
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
* of a parent, it is faster to just 0 the count rather than calling
* this function on each child. */
void
-virDomainSnapshotDropParent(virDomainSnapshotObjPtr snapshot)
+virDomainMomentDropParent(virDomainMomentObjPtr moment)
{
- virDomainSnapshotObjPtr prev = NULL;
- virDomainSnapshotObjPtr curr = NULL;
+ virDomainMomentObjPtr prev = NULL;
+ virDomainMomentObjPtr curr = NULL;
- snapshot->parent->nchildren--;
- curr = snapshot->parent->first_child;
- while (curr != snapshot) {
+ moment->parent->nchildren--;
+ curr = moment->parent->first_child;
+ while (curr != moment) {
if (!curr) {
VIR_WARN("inconsistent snapshot relations");
return;
@@ -115,42 +115,42 @@ virDomainSnapshotDropParent(virDomainSnapshotObjPtr snapshot)
curr = curr->sibling;
}
if (prev)
- prev->sibling = snapshot->sibling;
+ prev->sibling = moment->sibling;
else
- snapshot->parent->first_child = snapshot->sibling;
- snapshot->parent = NULL;
- snapshot->sibling = NULL;
+ moment->parent->first_child = moment->sibling;
+ moment->parent = NULL;
+ moment->sibling = NULL;
}
-/* Update @snapshot to no longer have children. */
+/* Update @moment to no longer have children. */
void
-virDomainSnapshotDropChildren(virDomainSnapshotObjPtr snapshot)
+virDomainMomentDropChildren(virDomainMomentObjPtr moment)
{
- snapshot->nchildren = 0;
- snapshot->first_child = NULL;
+ moment->nchildren = 0;
+ moment->first_child = NULL;
}
-/* Add @snapshot to @parent's list of children. */
+/* Add @moment to @parent's list of children. */
void
-virDomainSnapshotSetParent(virDomainSnapshotObjPtr snapshot,
- virDomainSnapshotObjPtr parent)
+virDomainMomentSetParent(virDomainMomentObjPtr moment,
+ virDomainMomentObjPtr parent)
{
- snapshot->parent = parent;
+ moment->parent = parent;
parent->nchildren++;
- snapshot->sibling = parent->first_child;
- parent->first_child = snapshot;
+ moment->sibling = parent->first_child;
+ parent->first_child = moment;
}
/* Take all children of @from and convert them into children of @to. */
void
-virDomainSnapshotMoveChildren(virDomainSnapshotObjPtr from,
- virDomainSnapshotObjPtr to)
+virDomainMomentMoveChildren(virDomainMomentObjPtr from,
+ virDomainMomentObjPtr to)
{
- virDomainSnapshotObjPtr child;
- virDomainSnapshotObjPtr last;
+ virDomainMomentObjPtr child;
+ virDomainMomentObjPtr last;
for (child = from->first_child; child; child = child->sibling) {
child->parent = to;
diff --git a/src/conf/virdomainsnapshotobjlist.c b/src/conf/virdomainsnapshotobjlist.c
index a55448c887..8ecb131176 100644
--- a/src/conf/virdomainsnapshotobjlist.c
+++ b/src/conf/virdomainsnapshotobjlist.c
@@ -35,12 +35,12 @@
VIR_LOG_INIT("conf.virdomainsnapshotobjlist");
struct _virDomainSnapshotObjList {
- /* name string -> virDomainSnapshotObj mapping
+ /* name string -> virDomainMomentObj mapping
* for O(1), lockless lookup-by-name */
virHashTable *objs;
- virDomainSnapshotObj metaroot; /* Special parent of all root snapshots */
- virDomainSnapshotObjPtr current; /* The current snapshot, if any */
+ virDomainMomentObj metaroot; /* Special parent of all root snapshots */
+ virDomainMomentObjPtr current; /* The current snapshot, if any */
};
@@ -62,7 +62,7 @@ virDomainSnapshotObjListParse(const char *xmlStr,
int n;
size_t i;
int keepBlanksDefault = xmlKeepBlanksDefault(0);
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
VIR_AUTOFREE(xmlNodePtr *) nodes = NULL;
VIR_AUTOFREE(char *) current = NULL;
@@ -168,7 +168,7 @@ virDomainSnapshotFormatOne(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *opaque)
{
- virDomainSnapshotObjPtr snap = payload;
+ virDomainMomentObjPtr snap = payload;
struct virDomainSnapshotFormatData *data = opaque;
return virDomainSnapshotDefFormatInternal(data->buf, data->uuidstr,
virDomainSnapshotObjGetDef(snap),
@@ -212,9 +212,9 @@ virDomainSnapshotObjListFormat(virBufferPtr buf,
/* Snapshot Obj functions */
-static virDomainSnapshotObjPtr virDomainSnapshotObjNew(void)
+static virDomainMomentObjPtr virDomainMomentObjNew(void)
{
- virDomainSnapshotObjPtr snapshot;
+ virDomainMomentObjPtr snapshot;
if (VIR_ALLOC(snapshot) < 0)
return NULL;
@@ -224,7 +224,7 @@ static virDomainSnapshotObjPtr virDomainSnapshotObjNew(void)
return snapshot;
}
-static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr snapshot)
+static void virDomainMomentObjFree(virDomainMomentObjPtr snapshot)
{
if (!snapshot)
return;
@@ -235,10 +235,10 @@ static void virDomainSnapshotObjFree(virDomainSnapshotObjPtr
snapshot)
VIR_FREE(snapshot);
}
-virDomainSnapshotObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr
snapshots,
- virDomainSnapshotDefPtr def)
+virDomainMomentObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots,
+ virDomainSnapshotDefPtr def)
{
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
if (virHashLookup(snapshots->objs, def->common.name) != NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -247,7 +247,7 @@ virDomainSnapshotObjPtr
virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s
return NULL;
}
- if (!(snap = virDomainSnapshotObjNew()))
+ if (!(snap = virDomainMomentObjNew()))
return NULL;
snap->def = &def->common;
@@ -261,7 +261,7 @@ virDomainSnapshotObjPtr
virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr s
/* Snapshot Obj List functions */
static bool
-virDomainSnapshotFilter(virDomainSnapshotObjPtr obj,
+virDomainSnapshotFilter(virDomainMomentObjPtr obj,
unsigned int flags)
{
virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(obj);
@@ -296,9 +296,9 @@ static void
virDomainSnapshotObjListDataFree(void *payload,
const void *name ATTRIBUTE_UNUSED)
{
- virDomainSnapshotObjPtr obj = payload;
+ virDomainMomentObjPtr obj = payload;
- virDomainSnapshotObjFree(obj);
+ virDomainMomentObjFree(obj);
}
virDomainSnapshotObjListPtr
@@ -325,21 +325,21 @@ virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots)
}
-struct virDomainSnapshotNameData {
+struct virDomainMomentNameData {
char **const names;
int maxnames;
unsigned int flags;
int count;
bool error;
- virDomainSnapshotObjListFilter filter;
+ virDomainMomentObjListFilter filter;
};
-static int virDomainSnapshotObjListCopyNames(void *payload,
- const void *name ATTRIBUTE_UNUSED,
- void *opaque)
+static int virDomainMomentObjListCopyNames(void *payload,
+ const void *name ATTRIBUTE_UNUSED,
+ void *opaque)
{
- virDomainSnapshotObjPtr obj = payload;
- struct virDomainSnapshotNameData *data = opaque;
+ virDomainMomentObjPtr obj = payload;
+ struct virDomainMomentNameData *data = opaque;
if (data->error)
return 0;
@@ -364,13 +364,13 @@ static int virDomainSnapshotObjListCopyNames(void *payload,
int
virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr from,
+ virDomainMomentObjPtr from,
char **const names,
int maxnames,
unsigned int flags)
{
- struct virDomainSnapshotNameData data = { names, maxnames, flags, 0,
- false, virDomainSnapshotFilter };
+ struct virDomainMomentNameData data = { names, maxnames, flags, 0,
+ false, virDomainSnapshotFilter };
size_t i;
if (!from) {
@@ -414,17 +414,17 @@ virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr
snapshots,
* simpler full hashtable visit or counter will do. */
if (from->def || (names &&
(flags & VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL)))
- virDomainSnapshotForEachDescendant(from,
- virDomainSnapshotObjListCopyNames,
- &data);
+ virDomainMomentForEachDescendant(from,
+ virDomainMomentObjListCopyNames,
+ &data);
else if (names || data.flags)
- virHashForEach(snapshots->objs, virDomainSnapshotObjListCopyNames,
+ virHashForEach(snapshots->objs, virDomainMomentObjListCopyNames,
&data);
else
data.count = virHashSize(snapshots->objs);
} else if (names || data.flags) {
- virDomainSnapshotForEachChild(from,
- virDomainSnapshotObjListCopyNames, &data);
+ virDomainMomentForEachChild(from,
+ virDomainMomentObjListCopyNames, &data);
} else {
data.count = from->nchildren;
}
@@ -440,13 +440,13 @@ virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr
snapshots,
int
virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr from,
+ virDomainMomentObjPtr from,
unsigned int flags)
{
return virDomainSnapshotObjListGetNames(snapshots, from, NULL, 0, flags);
}
-virDomainSnapshotObjPtr
+virDomainMomentObjPtr
virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots,
const char *name)
{
@@ -463,7 +463,7 @@ virDomainSnapshotObjListSize(virDomainSnapshotObjListPtr snapshots)
/* Return the current snapshot, or NULL */
-virDomainSnapshotObjPtr
+virDomainMomentObjPtr
virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots)
{
return snapshots->current;
@@ -492,7 +492,7 @@ virDomainSnapshotIsCurrentName(virDomainSnapshotObjListPtr snapshots,
/* Update the current snapshot, using NULL if no current remains */
void
virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr snapshot)
+ virDomainMomentObjPtr snapshot)
{
snapshots->current = snapshot;
}
@@ -500,7 +500,7 @@ virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots,
/* Remove snapshot from the list; return true if it was current */
bool virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr snapshot)
+ virDomainMomentObjPtr snapshot)
{
bool ret = snapshots->current == snapshot;
virHashRemoveEntry(snapshots->objs, snapshot->def->name);
@@ -514,7 +514,7 @@ void
virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots)
{
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
* indicator gets set if a parent is missing or a requested parent would
* cause a circular parent chain. */
-struct snapshot_set_relation {
+struct moment_set_relation {
virDomainSnapshotObjListPtr snapshots;
int err;
};
static int
-virDomainSnapshotSetRelations(void *payload,
- const void *name ATTRIBUTE_UNUSED,
- void *data)
+virDomainMomentSetRelations(void *payload,
+ const void *name ATTRIBUTE_UNUSED,
+ void *data)
{
- virDomainSnapshotObjPtr obj = payload;
- struct snapshot_set_relation *curr = data;
- virDomainSnapshotObjPtr tmp;
- virDomainSnapshotObjPtr parent;
+ virDomainMomentObjPtr obj = payload;
+ struct moment_set_relation *curr = data;
+ virDomainMomentObjPtr tmp;
+ virDomainMomentObjPtr parent;
parent = virDomainSnapshotFindByName(curr->snapshots, obj->def->parent);
if (!parent) {
@@ -564,7 +564,7 @@ virDomainSnapshotSetRelations(void *payload,
tmp = tmp->parent;
}
}
- virDomainSnapshotSetParent(obj, parent);
+ virDomainMomentSetParent(obj, parent);
return 0;
}
@@ -575,10 +575,10 @@ virDomainSnapshotSetRelations(void *payload,
int
virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots)
{
- struct snapshot_set_relation act = { snapshots, 0 };
+ struct moment_set_relation act = { snapshots, 0 };
- virDomainSnapshotDropChildren(&snapshots->metaroot);
- virHashForEach(snapshots->objs, virDomainSnapshotSetRelations, &act);
+ virDomainMomentDropChildren(&snapshots->metaroot);
+ virHashForEach(snapshots->objs, virDomainMomentSetRelations, &act);
if (act.err)
snapshots->current = NULL;
return act.err;
@@ -587,7 +587,7 @@ virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr
snapshots)
int
virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
- virDomainSnapshotObjPtr from,
+ virDomainMomentObjPtr from,
virDomainPtr dom,
virDomainSnapshotPtr **snaps,
unsigned int flags)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index ffc1724850..02f383fdba 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -980,12 +980,12 @@ virDomainObjListRename;
# conf/virdomainsnapshotobj.h
-virDomainSnapshotDropChildren;
-virDomainSnapshotDropParent;
-virDomainSnapshotForEachChild;
-virDomainSnapshotForEachDescendant;
-virDomainSnapshotMoveChildren;
-virDomainSnapshotSetParent;
+virDomainMomentDropChildren;
+virDomainMomentDropParent;
+virDomainMomentForEachChild;
+virDomainMomentForEachDescendant;
+virDomainMomentMoveChildren;
+virDomainMomentSetParent;
# conf/virdomainsnapshotobjlist.h
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index bc02362495..f81d20e5f7 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -10632,7 +10632,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
virSecurityManagerPtr secManager,
virDomainObjPtr vm,
const char *migrateURI,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop,
bool standalone,
bool enableFips,
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 3219ac5e48..d4ed772280 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8448,7 +8448,7 @@ qemuFindQemuImgBinary(virQEMUDriverPtr driver)
int
qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
const char *snapshotDir)
@@ -8566,7 +8566,7 @@ qemuDomainSnapshotForEachQcow2Raw(virQEMUDriverPtr driver,
int
qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
const char *op,
bool try_all)
{
@@ -8585,14 +8585,14 @@ qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver,
int
qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
bool update_parent,
bool metadata_only)
{
char *snapFile = NULL;
int ret = -1;
qemuDomainObjPrivatePtr priv;
- virDomainSnapshotObjPtr parentsnap = NULL;
+ virDomainMomentObjPtr parentsnap = NULL;
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
if (!metadata_only) {
@@ -8638,7 +8638,7 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver,
if (unlink(snapFile) < 0)
VIR_WARN("Failed to unlink %s", snapFile);
if (update_parent)
- virDomainSnapshotDropParent(snap);
+ virDomainMomentDropParent(snap);
virDomainSnapshotObjListRemove(vm->snapshots, snap);
ret = 0;
@@ -8654,7 +8654,7 @@ int qemuDomainSnapshotDiscardAll(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *data)
{
- virDomainSnapshotObjPtr snap = payload;
+ virDomainMomentObjPtr snap = payload;
virQEMUSnapRemovePtr curr = data;
int err;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9ad7be5718..9c2245b095 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -198,11 +198,11 @@ qemuDomObjFromSnapshot(virDomainSnapshotPtr snapshot)
/* Looks up snapshot object from VM and name */
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
qemuSnapObjFromName(virDomainObjPtr vm,
const char *name)
{
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
snap = virDomainSnapshotFindByName(vm->snapshots, name);
if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
@@ -214,7 +214,7 @@ qemuSnapObjFromName(virDomainObjPtr vm,
/* Looks up snapshot object from VM and snapshotPtr */
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
qemuSnapObjFromSnapshot(virDomainObjPtr vm,
virDomainSnapshotPtr snapshot)
{
@@ -417,8 +417,8 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm,
char *xmlStr;
char *fullpath;
virDomainSnapshotDefPtr def = NULL;
- virDomainSnapshotObjPtr snap = NULL;
- virDomainSnapshotObjPtr current = NULL;
+ virDomainMomentObjPtr snap = NULL;
+ virDomainMomentObjPtr current = NULL;
bool cur;
unsigned int flags = (VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE |
VIR_DOMAIN_SNAPSHOT_PARSE_DISKS |
@@ -2140,7 +2140,7 @@ qemuDomainSnapshotCountExternal(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *data)
{
- virDomainSnapshotObjPtr snap = payload;
+ virDomainMomentObjPtr snap = payload;
int *count = data;
if (virDomainSnapshotIsExternal(snap))
@@ -14513,7 +14513,7 @@ qemuDomainSnapshotFSThaw(virQEMUDriverPtr driver
ATTRIBUTE_UNUSED,
static int
qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap)
+ virDomainMomentObjPtr snap)
{
return qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-c", false);
}
@@ -14523,7 +14523,7 @@ qemuDomainSnapshotCreateInactiveInternal(virQEMUDriverPtr driver,
static int
qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
bool reuse)
{
size_t i;
@@ -14630,7 +14630,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
static int
qemuDomainSnapshotCreateActiveInternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
unsigned int flags)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
@@ -15176,7 +15176,7 @@ qemuDomainSnapshotDiskDataFree(qemuDomainSnapshotDiskDataPtr
data,
static qemuDomainSnapshotDiskDataPtr
qemuDomainSnapshotDiskDataCollect(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
bool reuse)
{
size_t i;
@@ -15333,7 +15333,7 @@ qemuDomainSnapshotCreateSingleDiskActive(virQEMUDriverPtr driver,
static int
qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
unsigned int flags,
qemuDomainAsyncJob asyncJob)
{
@@ -15462,7 +15462,7 @@ qemuDomainSnapshotCreateDiskActive(virQEMUDriverPtr driver,
static int
qemuDomainSnapshotCreateActiveExternal(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap,
+ virDomainMomentObjPtr snap,
unsigned int flags)
{
virObjectEventPtr event;
@@ -15660,14 +15660,14 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
virQEMUDriverPtr driver = domain->conn->privateData;
virDomainObjPtr vm = NULL;
char *xml = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotDefPtr def = NULL;
- virDomainSnapshotObjPtr current = NULL;
+ virDomainMomentObjPtr current = NULL;
bool update_current = true;
bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE;
unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS;
- virDomainSnapshotObjPtr other = NULL;
+ virDomainMomentObjPtr other = NULL;
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
bool align_match = true;
virQEMUDriverConfigPtr cfg = NULL;
@@ -15931,7 +15931,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
} else {
other = virDomainSnapshotFindByName(vm->snapshots,
snap->def->parent);
- virDomainSnapshotSetParent(snap, other);
+ virDomainMomentSetParent(snap, other);
}
} else if (snap) {
virDomainSnapshotObjListRemove(vm->snapshots, snap);
@@ -16035,7 +16035,7 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr
snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@@ -16065,7 +16065,7 @@ qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@@ -16095,7 +16095,7 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@@ -16126,7 +16126,7 @@ qemuDomainSnapshotLookupByName(virDomainPtr domain,
unsigned int flags)
{
virDomainObjPtr vm;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL;
virCheckFlags(0, NULL);
@@ -16176,7 +16176,7 @@ qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr parent = NULL;
virCheckFlags(0, NULL);
@@ -16241,7 +16241,7 @@ qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
virQEMUDriverPtr driver = virSnapDom(snapshot)->conn->privateData;
virDomainObjPtr vm = NULL;
char *xml = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virCheckFlags(VIR_DOMAIN_SNAPSHOT_XML_SECURE, NULL);
@@ -16273,7 +16273,7 @@ qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot,
{
virDomainObjPtr vm = NULL;
int ret = -1;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virCheckFlags(0, -1);
@@ -16300,7 +16300,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
{
virDomainObjPtr vm = NULL;
int ret = -1;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virCheckFlags(0, -1);
@@ -16328,7 +16328,7 @@ qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
static int
qemuDomainSnapshotRevertInactive(virQEMUDriverPtr driver,
virDomainObjPtr vm,
- virDomainSnapshotObjPtr snap)
+ virDomainMomentObjPtr snap)
{
/* Try all disks, but report failure if we skipped any. */
int ret = qemuDomainSnapshotForEachQcow2(driver, vm, snap, "-a", true);
@@ -16343,8 +16343,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
virQEMUDriverPtr driver = virSnapDom(snapshot)->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
- virDomainSnapshotObjPtr snap = NULL;
- virDomainSnapshotObjPtr current = NULL;
+ virDomainMomentObjPtr snap = NULL;
+ virDomainMomentObjPtr current = NULL;
virDomainSnapshotDefPtr snapdef;
virObjectEventPtr event = NULL;
virObjectEventPtr event2 = NULL;
@@ -16762,7 +16762,7 @@ typedef struct _virQEMUSnapReparent virQEMUSnapReparent;
typedef virQEMUSnapReparent *virQEMUSnapReparentPtr;
struct _virQEMUSnapReparent {
virQEMUDriverConfigPtr cfg;
- virDomainSnapshotObjPtr parent;
+ virDomainMomentObjPtr parent;
virDomainObjPtr vm;
virCapsPtr caps;
virDomainXMLOptionPtr xmlopt;
@@ -16775,7 +16775,7 @@ qemuDomainSnapshotReparentChildren(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *data)
{
- virDomainSnapshotObjPtr snap = payload;
+ virDomainMomentObjPtr snap = payload;
virQEMUSnapReparentPtr rep = data;
if (rep->err < 0)
@@ -16803,7 +16803,7 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
virQEMUDriverPtr driver = virSnapDom(snapshot)->conn->privateData;
virDomainObjPtr vm = NULL;
int ret = -1;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virQEMUSnapRemove rem;
virQEMUSnapReparent rep;
bool metadata_only = !!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY);
@@ -16834,9 +16834,9 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
external++;
if (flags & (VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY))
- virDomainSnapshotForEachDescendant(snap,
- qemuDomainSnapshotCountExternal,
- &external);
+ virDomainMomentForEachDescendant(snap,
+ qemuDomainSnapshotCountExternal,
+ &external);
if (external) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("deletion of %d external disk snapshots not "
@@ -16852,9 +16852,9 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
rem.metadata_only = metadata_only;
rem.err = 0;
rem.current = false;
- virDomainSnapshotForEachDescendant(snap,
- qemuDomainSnapshotDiscardAll,
- &rem);
+ virDomainMomentForEachDescendant(snap,
+ qemuDomainSnapshotDiscardAll,
+ &rem);
if (rem.err < 0)
goto endjob;
if (rem.current) {
@@ -16878,16 +16878,16 @@ qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
rep.err = 0;
rep.caps = driver->caps;
rep.xmlopt = driver->xmlopt;
- virDomainSnapshotForEachChild(snap,
- qemuDomainSnapshotReparentChildren,
- &rep);
+ virDomainMomentForEachChild(snap,
+ qemuDomainSnapshotReparentChildren,
+ &rep);
if (rep.err < 0)
goto endjob;
- virDomainSnapshotMoveChildren(snap, snap->parent);
+ virDomainMomentMoveChildren(snap, snap->parent);
}
if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) {
- virDomainSnapshotDropChildren(snap);
+ virDomainMomentDropChildren(snap);
ret = 0;
} else {
ret = qemuDomainSnapshotDiscard(driver, vm, snap, true, metadata_only);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d878079eab..dc7317b723 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6469,7 +6469,7 @@ qemuProcessLaunch(virConnectPtr conn,
virDomainObjPtr vm,
qemuDomainAsyncJob asyncJob,
qemuProcessIncomingDefPtr incoming,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop,
unsigned int flags)
{
@@ -6882,7 +6882,7 @@ qemuProcessStart(virConnectPtr conn,
const char *migrateFrom,
int migrateFd,
const char *migratePath,
- virDomainSnapshotObjPtr snapshot,
+ virDomainMomentObjPtr snapshot,
virNetDevVPortProfileOp vmop,
unsigned int flags)
{
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index eac6160532..5aaaf0ab19 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -822,7 +822,7 @@ testParseDomainSnapshots(testDriverPtr privconn,
bool cur;
for (i = 0; i < nsdata->num_snap_nodes; i++) {
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotDefPtr def;
xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file,
"domainsnapshot");
@@ -5946,11 +5946,11 @@ testDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
* Snapshot APIs
*/
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
testSnapObjFromName(virDomainObjPtr vm,
const char *name)
{
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
snap = virDomainSnapshotFindByName(vm->snapshots, name);
if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
@@ -5959,7 +5959,7 @@ testSnapObjFromName(virDomainObjPtr vm,
return snap;
}
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
testSnapObjFromSnapshot(virDomainObjPtr vm,
virDomainSnapshotPtr snapshot)
{
@@ -6042,7 +6042,7 @@ testDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@@ -6068,7 +6068,7 @@ testDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@@ -6094,7 +6094,7 @@ testDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
int n = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS |
@@ -6121,7 +6121,7 @@ testDomainSnapshotLookupByName(virDomainPtr domain,
unsigned int flags)
{
virDomainObjPtr vm;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL;
virCheckFlags(0, NULL);
@@ -6162,7 +6162,7 @@ testDomainSnapshotGetParent(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr parent = NULL;
virCheckFlags(0, NULL);
@@ -6193,7 +6193,7 @@ testDomainSnapshotCurrent(virDomainPtr domain,
{
virDomainObjPtr vm;
virDomainSnapshotPtr snapshot = NULL;
- virDomainSnapshotObjPtr current;
+ virDomainMomentObjPtr current;
virCheckFlags(0, NULL);
@@ -6220,7 +6220,7 @@ testDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
{
virDomainObjPtr vm = NULL;
char *xml = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
testDriverPtr privconn = virSnapDom(snapshot)->conn->privateData;
@@ -6322,7 +6322,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
testDriverPtr privconn = domain->conn->privateData;
virDomainObjPtr vm = NULL;
virDomainSnapshotDefPtr def = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virDomainSnapshotPtr snapshot = NULL;
virObjectEventPtr event = NULL;
bool update_current = true;
@@ -6411,12 +6411,12 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
cleanup:
if (vm) {
if (snapshot) {
- virDomainSnapshotObjPtr other;
+ virDomainMomentObjPtr other;
if (update_current)
virDomainSnapshotSetCurrent(vm->snapshots, snap);
other = virDomainSnapshotFindByName(vm->snapshots,
snap->def->parent);
- virDomainSnapshotSetParent(snap, other);
+ virDomainMomentSetParent(snap, other);
}
virDomainObjEndAPI(&vm);
}
@@ -6438,7 +6438,7 @@ testDomainSnapshotDiscardAll(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *data)
{
- virDomainSnapshotObjPtr snap = payload;
+ virDomainMomentObjPtr snap = payload;
testSnapRemoveDataPtr curr = data;
curr->current |= virDomainSnapshotObjListRemove(curr->vm->snapshots, snap);
@@ -6448,7 +6448,7 @@ testDomainSnapshotDiscardAll(void *payload,
typedef struct _testSnapReparentData testSnapReparentData;
typedef testSnapReparentData *testSnapReparentDataPtr;
struct _testSnapReparentData {
- virDomainSnapshotObjPtr parent;
+ virDomainMomentObjPtr parent;
virDomainObjPtr vm;
int err;
};
@@ -6458,7 +6458,7 @@ testDomainSnapshotReparentChildren(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *data)
{
- virDomainSnapshotObjPtr snap = payload;
+ virDomainMomentObjPtr snap = payload;
testSnapReparentDataPtr rep = data;
if (rep->err < 0)
@@ -6480,8 +6480,8 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
- virDomainSnapshotObjPtr parentsnap = NULL;
+ virDomainMomentObjPtr snap = NULL;
+ virDomainMomentObjPtr parentsnap = NULL;
int ret = -1;
virCheckFlags(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN |
@@ -6498,9 +6498,9 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
testSnapRemoveData rem;
rem.vm = vm;
rem.current = false;
- virDomainSnapshotForEachDescendant(snap,
- testDomainSnapshotDiscardAll,
- &rem);
+ virDomainMomentForEachDescendant(snap,
+ testDomainSnapshotDiscardAll,
+ &rem);
if (rem.current)
virDomainSnapshotSetCurrent(vm->snapshots, snap);
} else if (snap->nchildren) {
@@ -6508,19 +6508,19 @@ testDomainSnapshotDelete(virDomainSnapshotPtr snapshot,
rep.parent = snap->parent;
rep.vm = vm;
rep.err = 0;
- virDomainSnapshotForEachChild(snap,
- testDomainSnapshotReparentChildren,
- &rep);
+ virDomainMomentForEachChild(snap,
+ testDomainSnapshotReparentChildren,
+ &rep);
if (rep.err < 0)
goto cleanup;
- virDomainSnapshotMoveChildren(snap, snap->parent);
+ virDomainMomentMoveChildren(snap, snap->parent);
}
if (flags & VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY) {
- virDomainSnapshotDropChildren(snap);
+ virDomainMomentDropChildren(snap);
} else {
- virDomainSnapshotDropParent(snap);
+ virDomainMomentDropParent(snap);
if (snap == virDomainSnapshotGetCurrent(vm->snapshots)) {
if (snap->def->parent) {
parentsnap = virDomainSnapshotFindByName(vm->snapshots,
@@ -6546,7 +6546,7 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
{
testDriverPtr privconn = virSnapDom(snapshot)->conn->privateData;
virDomainObjPtr vm = NULL;
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
virObjectEventPtr event = NULL;
virObjectEventPtr event2 = NULL;
virDomainDefPtr config = NULL;
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index eba366dd2c..06f94f5beb 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -2132,10 +2132,10 @@ static int vzDomainSetMemory(virDomainPtr domain, unsigned long
memory)
return ret;
}
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char *name)
{
- virDomainSnapshotObjPtr snap = NULL;
+ virDomainMomentObjPtr snap = NULL;
snap = virDomainSnapshotFindByName(snapshots, name);
if (!snap)
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
@@ -2144,7 +2144,7 @@ vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char
*name)
return snap;
}
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotPtr snapshot)
{
@@ -2156,8 +2156,8 @@ vzCurrentSnapshotIterator(void *payload,
const void *name ATTRIBUTE_UNUSED,
void *data)
{
- virDomainSnapshotObjPtr snapshot = payload;
- virDomainSnapshotObjPtr *current = data;
+ virDomainMomentObjPtr snapshot = payload;
+ virDomainMomentObjPtr *current = data;
if (snapshot->def->current)
*current = snapshot;
@@ -2165,10 +2165,10 @@ vzCurrentSnapshotIterator(void *payload,
return 0;
}
-static virDomainSnapshotObjPtr
+static virDomainMomentObjPtr
vzFindCurrentSnapshot(virDomainSnapshotObjListPtr snapshots)
{
- virDomainSnapshotObjPtr current = NULL;
+ virDomainMomentObjPtr current = NULL;
virDomainSnapshotForEach(snapshots, vzCurrentSnapshotIterator, ¤t);
return current;
@@ -2268,7 +2268,7 @@ vzDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned
int flags)
{
virDomainObjPtr dom;
char *xml = NULL;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
char uuidstr[VIR_UUID_STRING_BUFLEN];
virDomainSnapshotObjListPtr snapshots = NULL;
vzConnPtr privconn = virSnapDom(snapshot)->conn->privateData;
@@ -2304,7 +2304,7 @@ static int
vzDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, unsigned int flags)
{
virDomainObjPtr dom;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL;
int n = -1;
@@ -2339,7 +2339,7 @@ vzDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr dom;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL;
int n = -1;
@@ -2373,7 +2373,7 @@ vzDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot,
unsigned int flags)
{
virDomainObjPtr dom;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL;
int n = -1;
@@ -2407,7 +2407,7 @@ vzDomainSnapshotLookupByName(virDomainPtr domain,
unsigned int flags)
{
virDomainObjPtr dom;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotObjListPtr snapshots = NULL;
@@ -2465,7 +2465,7 @@ static virDomainSnapshotPtr
vzDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags)
{
virDomainObjPtr dom;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotPtr parent = NULL;
virDomainSnapshotObjListPtr snapshots = NULL;
@@ -2505,7 +2505,7 @@ vzDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags)
virDomainObjPtr dom;
virDomainSnapshotPtr snapshot = NULL;
virDomainSnapshotObjListPtr snapshots = NULL;
- virDomainSnapshotObjPtr current;
+ virDomainMomentObjPtr current;
virCheckFlags(0, NULL);
@@ -2539,7 +2539,7 @@ vzDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned
int flags)
virDomainObjPtr dom;
int ret = -1;
virDomainSnapshotObjListPtr snapshots = NULL;
- virDomainSnapshotObjPtr current;
+ virDomainMomentObjPtr current;
virCheckFlags(0, -1);
@@ -2568,7 +2568,7 @@ vzDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
{
virDomainObjPtr dom;
int ret = -1;
- virDomainSnapshotObjPtr snap;
+ virDomainMomentObjPtr snap;
virDomainSnapshotObjListPtr snapshots = NULL;
virCheckFlags(0, -1);
@@ -2606,7 +2606,7 @@ vzDomainSnapshotCreateXML(virDomainPtr domain,
vzDriverPtr driver = privconn->driver;
unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS;
virDomainSnapshotObjListPtr snapshots = NULL;
- virDomainSnapshotObjPtr current;
+ virDomainMomentObjPtr current;
bool job = false;
virCheckFlags(0, NULL);
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index b9fd03c0d2..f5a59115d2 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -4655,8 +4655,8 @@ prlsdkParseSnapshotTree(const char *treexml)
xmlNodePtr root;
xmlNodePtr *nodes = NULL;
virDomainSnapshotDefPtr def = NULL;
- virDomainSnapshotObjPtr snapshot;
- virDomainSnapshotObjPtr current = NULL;
+ virDomainMomentObjPtr snapshot;
+ virDomainMomentObjPtr current = NULL;
virDomainSnapshotObjListPtr snapshots = NULL;
char *xmlstr = NULL;
int n;
--
2.20.1