mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: Don't reuse variable for different object in virDomainCheckpointRedefinePrep
The 'other' variable was used to store the parent of the redefined checkpoint and then the existing version of the currently redefined checkpoint. Make it less confusing by adding a 'parent' variable for the first case. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
e0a4a011c1
commit
4d60e7fdd4
@ -534,6 +534,7 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
|
|||||||
{
|
{
|
||||||
virDomainCheckpointDefPtr def = *defptr;
|
virDomainCheckpointDefPtr def = *defptr;
|
||||||
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
|
virDomainMomentObjPtr parent = NULL;
|
||||||
virDomainMomentObjPtr other = NULL;
|
virDomainMomentObjPtr other = NULL;
|
||||||
virDomainCheckpointDefPtr otherdef = NULL;
|
virDomainCheckpointDefPtr otherdef = NULL;
|
||||||
|
|
||||||
@ -552,12 +553,13 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm,
|
|||||||
if (virDomainCheckpointAlignDisks(def) < 0)
|
if (virDomainCheckpointAlignDisks(def) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (def->parent.parent_name)
|
if (def->parent.parent_name &&
|
||||||
other = virDomainCheckpointFindByName(vm->checkpoints,
|
(parent = virDomainCheckpointFindByName(vm->checkpoints,
|
||||||
def->parent.parent_name);
|
def->parent.parent_name))) {
|
||||||
if (other == virDomainCheckpointGetCurrent(vm->checkpoints)) {
|
if (parent == virDomainCheckpointGetCurrent(vm->checkpoints)) {
|
||||||
*update_current = true;
|
*update_current = true;
|
||||||
virDomainCheckpointSetCurrent(vm->checkpoints, NULL);
|
virDomainCheckpointSetCurrent(vm->checkpoints, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name);
|
other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name);
|
||||||
|
Loading…
Reference in New Issue
Block a user