Yaniv Bronhaim has submitted this change and it was merged. Change subject: vm: avoid race while setting guest cpu status ......................................................................
vm: avoid race while setting guest cpu status Inside the Vm class, the state swapping is not atomic. This is because the reported state is function of two internal fields, lastStatus and guestCpuRunning, which may be updated concurrently and not atomically. One clear example for this is BZ1111938, on which we see a race between pause(), onLibvirtLifeCycle() and getStats(), which makes a Vm incorrectly reported as 'Paused' (instead of 'Saving State'), which confuses Engine. To fix this, we make use of the guestCpuLock everywhere we change the state of the guest CPU, in order to synchronize access to the field with respect to pause() and cont() methods. While good enough for the short term, more aggressive refactoring is needed in this area. Change-Id: I3aea96c7122d60e6cb888273678b565c3f3e537f Bug-Url: https://bugzilla.redhat.com/1111938 Signed-off-by: Francesco Romani <[email protected]> Reviewed-on: http://gerrit.ovirt.org/29113 Reviewed-by: Michal Skrivanek <[email protected]> Reviewed-by: Dan Kenigsberg <[email protected]> Reviewed-on: http://gerrit.ovirt.org/32462 Reviewed-by: Yaniv Bronhaim <[email protected]> --- M tests/vmTests.py M vdsm/virt/vm.py 2 files changed, 67 insertions(+), 12 deletions(-) Approvals: Yaniv Bronhaim: Looks good to me, approved Dan Kenigsberg: Looks good to me, but someone else must approve Francesco Romani: Verified -- To view, visit http://gerrit.ovirt.org/32462 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3aea96c7122d60e6cb888273678b565c3f3e537f Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.5 Gerrit-Owner: Francesco Romani <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Michal Skrivanek <[email protected]> Gerrit-Reviewer: Yaniv Bronhaim <[email protected]> Gerrit-Reviewer: [email protected] _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
