mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemuSnapshotCreateAlignDisks: Rewrite logic for selecting default memory snapshot mode
Use an if/else branch rather than a expression with a ternary operator. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
a4752ce6ef
commit
8a0e9e106b
@ -1672,9 +1672,10 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
return -1;
|
||||
}
|
||||
|
||||
def->memory = (def->state == VIR_DOMAIN_SNAPSHOT_SHUTOFF ?
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_NONE :
|
||||
VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL);
|
||||
if (def->state == VIR_DOMAIN_SNAPSHOT_SHUTOFF)
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NONE;
|
||||
else
|
||||
def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
|
||||
}
|
||||
if (virDomainSnapshotAlignDisks(def, NULL, align_location, true) < 0)
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user