mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03: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
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user