Francesco Romani has uploaded a new change for review.
Change subject: API: use modern locking around VM.destroy ......................................................................
API: use modern locking around VM.destroy
cleanup a bit VM.destroy() without functional changes:
- log outside the lock - use context managers for lock
Change-Id: I799b3b0d3e992df988efc6ab8e9263909062db0c Signed-off-by: Francesco Romani fromani@redhat.com --- M vdsm/API.py 1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/42889/1
diff --git a/vdsm/API.py b/vdsm/API.py index 242783d..55eaa80 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -332,9 +332,11 @@ """ Destroy the specified VM. """ - self._cif.vmContainerLock.acquire() - self.log.info("vmContainerLock acquired by vm %s", self._UUID) - try: + self.log.debug('About to destroy VM %s (reason=%s)', + self._UUID, + 'N/A' if reason == vmexitreason.SUCCESS + else str(reason)) + with self._cif.vmContainerLock: v = self._cif.vmContainer.get(self._UUID) if not v: return errCode['noVM'] @@ -343,8 +345,6 @@ if status['status']['code'] == 0: status['status']['message'] = "Machine destroyed" return status - finally: - self._cif.vmContainerLock.release()
def getMigrationStatus(self): """
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 4:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 5:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 6:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 7:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 8:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 9:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Yaniv Bronhaim has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 9: Code-Review+1
Dan Kenigsberg has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 9: Code-Review+2
Francesco Romani has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 9: Verified+1
verified doing a few start/stop cycles with no issues spotted.
Dan Kenigsberg has submitted this change and it was merged.
Change subject: API: use modern locking around VM.destroy ......................................................................
API: use modern locking around VM.destroy
cleanup a bit VM.destroy() without functional changes:
- log outside the lock - use context managers for lock
Change-Id: I799b3b0d3e992df988efc6ab8e9263909062db0c Signed-off-by: Francesco Romani fromani@redhat.com Reviewed-on: https://gerrit.ovirt.org/42889 Continuous-Integration: Jenkins CI Reviewed-by: Yaniv Bronhaim ybronhei@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/API.py 1 file changed, 3 insertions(+), 5 deletions(-)
Approvals: Yaniv Bronhaim: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified
automation@ovirt.org has posted comments on this change.
Change subject: API: use modern locking around VM.destroy ......................................................................
Patch Set 10:
* Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found.
vdsm-patches@lists.fedorahosted.org