virDomainSnapshotAlignDisks: Convert @default_snapshot to virDomainSnapshotLocation

Use the appropriate type for the variable and fix all callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-01-12 12:52:16 +01:00
parent 94686f1919
commit 311b300d85
4 changed files with 5 additions and 5 deletions

View File

@ -473,7 +473,7 @@ virDomainSnapshotRedefineValidate(virDomainSnapshotDef *def,
virDomainXMLOption *xmlopt, virDomainXMLOption *xmlopt,
unsigned int flags) unsigned int flags)
{ {
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; virDomainSnapshotLocation align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
bool align_match = true; bool align_match = true;
bool external = def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT || bool external = def->state == VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT ||
virDomainSnapshotDefIsExternal(def); virDomainSnapshotDefIsExternal(def);
@ -640,7 +640,7 @@ virDomainSnapshotDefAssignExternalNames(virDomainSnapshotDef *def)
*/ */
int int
virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapdef, virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapdef,
int default_snapshot, virDomainSnapshotLocation default_snapshot,
bool require_match) bool require_match)
{ {
virDomainDef *domdef = snapdef->parent.dom; virDomainDef *domdef = snapdef->parent.dom;

View File

@ -126,7 +126,7 @@ char *virDomainSnapshotDefFormat(const char *uuidstr,
virDomainXMLOption *xmlopt, virDomainXMLOption *xmlopt,
unsigned int flags); unsigned int flags);
int virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapshot, int virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapshot,
int default_snapshot, virDomainSnapshotLocation default_snapshot,
bool require_match); bool require_match);
bool virDomainSnapshotDefIsExternal(virDomainSnapshotDef *def); bool virDomainSnapshotDefIsExternal(virDomainSnapshotDef *def);

View File

@ -1630,7 +1630,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
{ {
g_autofree char *xml = NULL; g_autofree char *xml = NULL;
qemuDomainObjPrivate *priv = vm->privateData; qemuDomainObjPrivate *priv = vm->privateData;
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; virDomainSnapshotLocation align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
bool align_match = true; bool align_match = true;
/* Easiest way to clone inactive portion of vm->def is via /* Easiest way to clone inactive portion of vm->def is via

View File

@ -8717,7 +8717,7 @@ testDomainSnapshotAlignDisks(virDomainObj *vm,
virDomainSnapshotDef *def, virDomainSnapshotDef *def,
unsigned int flags) unsigned int flags)
{ {
int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; virDomainSnapshotLocation align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
bool align_match = true; bool align_match = true;
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) { if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) {