mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
snapshot: conf: Make virDomainSnapshotIsExternal more reusable
Allow to use definition objects with this predicate function.
This commit is contained in:
parent
346e43ecfd
commit
51b12b8cca
@ -1058,17 +1058,23 @@ cleanup:
|
|||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
|
virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (snap->def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
for (i = 0; i < snap->def->ndisks; i++) {
|
for (i = 0; i < def->ndisks; i++) {
|
||||||
if (snap->def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
if (def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap)
|
||||||
|
{
|
||||||
|
return virDomainSnapshotDefIsExternal(snap->def);
|
||||||
|
}
|
||||||
|
@ -166,6 +166,7 @@ int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots,
|
|||||||
virDomainSnapshotPtr **snaps,
|
virDomainSnapshotPtr **snaps,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
|
|
||||||
|
bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def);
|
||||||
bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap);
|
bool virDomainSnapshotIsExternal(virDomainSnapshotObjPtr snap);
|
||||||
|
|
||||||
VIR_ENUM_DECL(virDomainSnapshotLocation)
|
VIR_ENUM_DECL(virDomainSnapshotLocation)
|
||||||
|
@ -1097,6 +1097,7 @@ virDomainSnapshotAlignDisks;
|
|||||||
virDomainSnapshotAssignDef;
|
virDomainSnapshotAssignDef;
|
||||||
virDomainSnapshotDefFormat;
|
virDomainSnapshotDefFormat;
|
||||||
virDomainSnapshotDefFree;
|
virDomainSnapshotDefFree;
|
||||||
|
virDomainSnapshotDefIsExternal;
|
||||||
virDomainSnapshotDefParseString;
|
virDomainSnapshotDefParseString;
|
||||||
virDomainSnapshotDropParent;
|
virDomainSnapshotDropParent;
|
||||||
virDomainSnapshotFindByName;
|
virDomainSnapshotFindByName;
|
||||||
|
Loading…
Reference in New Issue
Block a user