提交 51b12b8c 编写于 作者: P Peter Krempa

snapshot: conf: Make virDomainSnapshotIsExternal more reusable

Allow to use definition objects with this predicate function.
上级 346e43ec
......@@ -1058,17 +1058,23 @@ cleanup:
bool
virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def)
{
int i;
if (snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
return true;
for (i = 0; i < snap->def->ndisks; i++) {
if (snap->def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
for (i = 0; i < def->ndisks; i++) {
if (def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
return true;
}
return false;
}
bool
virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
{
return virDomainSnapshotDefIsExternal(snap->def);
}
......@@ -166,6 +166,7 @@ int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
virDomainSnapshotPtr **snaps,
unsigned int flags);
bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def);
bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap);
VIR_ENUM_DECL(virDomainSnapshotLocation)
......
......@@ -1097,6 +1097,7 @@ virDomainSnapshotAlignDisks;
virDomainSnapshotAssignDef;
virDomainSnapshotDefFormat;
virDomainSnapshotDefFree;
virDomainSnapshotDefIsExternal;
virDomainSnapshotDefParseString;
virDomainSnapshotDropParent;
virDomainSnapshotFindByName;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册