From: "Jose A. Lopes" <[email protected]>

The QA test 'TestClusterBurnin' pauses instances and the Xen state
domain 'paused' was not being handled properly by Ganeti because it
was not being classified as either a running or shutdown state.  This
patch adds the 'paused' state to the set of running states by
extending the function 'ganeti.hypervisor.hv_xen._IsInstanceRunning'
with the corresponding Xen state string '--p---'.

This fixes the QA test 'TestClusterBurnin'.

Signed-off-by: Jose A. Lopes <[email protected]>
Reviewed-by: Helga Velroyen <[email protected]>

Cherry-picked from fd201010dfc5bd4334a374a3e3b592cdd03382fb.

Signed-off-by: Hrvoje Ribicic <[email protected]>
---
 lib/hypervisor/hv_xen.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py
index 85b1f59..326fccd 100644
--- a/lib/hypervisor/hv_xen.py
+++ b/lib/hypervisor/hv_xen.py
@@ -168,9 +168,14 @@ def _GetInstanceList(fn, include_node, _timeout=5):
   return _ParseInstanceList(lines, include_node)
 
 
+# Determine whether an instance is running
+#
+# An instance is running if it is in the following Xen states:
+# running, blocked, or paused.
 def _IsInstanceRunning(instance_info):
   return instance_info == "r-----" \
-      or instance_info == "-b----"
+      or instance_info == "-b----" \
+      or instance_info == "--p---"
 
 
 def _IsInstanceShutdown(instance_info):
-- 
2.0.0.526.g5318336

Reply via email to