Change in vdsm[ovirt-3.5]: vm: make _set_lastStatus safer

ybronhei at redhat.com ybronhei at redhat.com
Sun Jan 11 13:27:27 UTC 2015


Yaniv Bronhaim has submitted this change and it was merged.

Change subject: vm: make _set_lastStatus safer
......................................................................


vm: make _set_lastStatus safer

It is not safe to set concurrently state of a VM, because
the function which does that is not-trivial and racy.

This is a concrete risk in the case of QEMU dying
(or being killed, like in rhbz#1142776) unexpectedly
on Migration Source.

In this case, the race between the libvirt event handler
and the migration.SourceThread becomes evident, and
could end up in messing the Vm state.

This patch introduces a lock to make concurrent invocations
of _set_lastStatus safe(r).

Change-Id: I172c6a4d4bae156294f7f8944912c877f55ab5a0
Bug-Url: https://bugzilla.redhat.com/1174813
Related-To: https://bugzilla.redhat.com/1142776
Signed-off-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35896
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/35962
Reviewed-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 21 insertions(+), 14 deletions(-)

Approvals:
  Yaniv Bronhaim: Looks good to me, approved
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Verified



-- 
To view, visit http://gerrit.ovirt.org/35962
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I172c6a4d4bae156294f7f8944912c877f55ab5a0
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list