mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
cpu: Change control flow in virCPUUpdateLive
The updateLive CPU sub-driver function is supposed to be called only for a subset of CPU definitions. Let's make it more obvious by turning a negative test and return into a positive check. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7864380b19
commit
68c0b85ecb
@ -647,13 +647,14 @@ virCPUUpdateLive(virArch arch,
|
||||
if (!driver->updateLive)
|
||||
return 1;
|
||||
|
||||
if (cpu->mode != VIR_CPU_MODE_CUSTOM)
|
||||
return 1;
|
||||
if (cpu->mode == VIR_CPU_MODE_CUSTOM) {
|
||||
if (driver->updateLive(cpu, dataEnabled, dataDisabled) < 0)
|
||||
return -1;
|
||||
|
||||
if (driver->updateLive(cpu, dataEnabled, dataDisabled) < 0)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user