|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] Fix infinite loop in waitForSuspend
When guest responses the suspend request (on control/shutdown),
but fails on suspending, the xend will fall into an infinite
loop.
The following patch fixes this.
Signed-off-by: Frank Pan <frankpzh@xxxxxxxxx>
---
tools/python/xen/xend/XendDomainInfo.py | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/tools/python/xen/xend/XendDomainInfo.py
b/tools/python/xen/xend/XendDomainInfo.py
index d5e92be..2bbd510 100644
--- a/tools/python/xen/xend/XendDomainInfo.py
+++ b/tools/python/xen/xend/XendDomainInfo.py
@@ -2983,21 +2983,19 @@ class XendDomainInfo:
won't suspend, so we give up. HVM guests with no PV drivers
should already be shutdown.
"""
- state = "suspend"
nr_tries = 60
self.state_updated.acquire()
try:
while self._stateGet() in (DOM_STATE_RUNNING,DOM_STATE_PAUSED):
self.state_updated.wait(1.0)
- if state == "suspend":
- if nr_tries == 0:
- msg = ('Timeout waiting for domain %s to suspend'
- % self.domid)
- self._writeDom('control/shutdown', '')
- raise XendError(msg)
- state = self.readDom('control/shutdown')
- nr_tries -= 1
+ if nr_tries == 0:
+ msg = ('Timeout waiting for domain %s to suspend'
+ % self.domid)
+ self._writeDom('control/shutdown', '')
+ raise XendError(msg)
+ nr_tries -= 1
+
finally:
self.state_updated.release()
--
1.7.0.4
--
潘震皓, Frank Pan
Computer Science and Technology
Tsinghua University
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] [PATCH] Fix infinite loop in waitForSuspend,
Frank Pan <=
|
|
|
|
|