Change in vdsm[master]: virt: Move status constant to vmstatus

nsoffer at redhat.com nsoffer at redhat.com
Tue Feb 10 21:29:56 UTC 2015


Nir Soffer has uploaded a new change for review.

Change subject: virt: Move status constant to vmstatus
......................................................................

virt: Move status constant to vmstatus

_get_lastStatus was creating a temporary tuple using values from
vmstatus. The repeating "vmstatus." in this tuple tells us that the code
belongs in the vmstatus module.

Change-Id: Iad4e2bca91710848a6178f8bbde922bee1ba1cde
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/virt/vm.py
M vdsm/virt/vmstatus.py
2 files changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/37677/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index dc513cf..fd138ad 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -879,10 +879,8 @@
         # note that we don't use _statusLock here. One of the reasons is the
         # non-obvious recursive locking in the following flow:
         # _set_lastStatus() -> saveState() -> status() -> _get_lastStatus().
-        PAUSED_STATES = (vmstatus.POWERING_DOWN, vmstatus.REBOOT_IN_PROGRESS,
-                         vmstatus.UP)
         status = self._lastStatus
-        if not self._guestCpuRunning and status in PAUSED_STATES:
+        if not self._guestCpuRunning and status in vmstatus.PAUSED_STATES:
             return vmstatus.PAUSED
         return status
 
diff --git a/vdsm/virt/vmstatus.py b/vdsm/virt/vmstatus.py
index ffab32c..d58c1a3 100644
--- a/vdsm/virt/vmstatus.py
+++ b/vdsm/virt/vmstatus.py
@@ -29,3 +29,5 @@
 RESTORING_STATE = 'Restoring state'
 SAVING_STATE = 'Saving State'
 WAIT_FOR_LAUNCH = 'WaitForLaunch'
+
+PAUSED_STATES = (POWERING_DOWN, REBOOT_IN_PROGRESS, UP)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad4e2bca91710848a6178f8bbde922bee1ba1cde
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list