summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-09-20 22:46:46 +0000
committerJohannes Erdfelt <johannes.erdfelt@rackspace.com>2012-09-20 22:46:46 +0000
commita73de83bd13482f33066fc27524a58f194dcbe50 (patch)
treeaa1d93092e8ea67ab4d5fd2dade61594a0869078
parent1ec8b5d06cf5f5ff0dc0e2a5318ccfc05756d2a4 (diff)
downloadnova-a73de83bd13482f33066fc27524a58f194dcbe50.tar.gz
nova-a73de83bd13482f33066fc27524a58f194dcbe50.tar.xz
nova-a73de83bd13482f33066fc27524a58f194dcbe50.zip
libvirt: return after soft reboot successfully completes
A soft reboot shuts down an instance, waits for the instance to shutdown, then starts the instance and waits for the instance to finish starting. However, instead of returning success, it continues back into the loop and waits for the instance to be shutdown again. That will continue until the soft reboot times out, which is by default 120 seconds. This manifested itself as a unit test that would consistently take 120 seconds to run, but could possibly affect deployed environments by restarting instances that are shutdown shortly after a soft reboot. Change-Id: I012c53343be4b4eb943643903fc47c7fe70a594d
-rw-r--r--nova/virt/libvirt/driver.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py
index 41bbd2d22..567ed6ec8 100644
--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -900,6 +900,7 @@ class LibvirtDriver(driver.ComputeDriver):
self._create_domain(domain=dom)
timer = utils.LoopingCall(self._wait_for_running, instance)
timer.start(interval=0.5).wait()
+ return True
greenthread.sleep(1)
return False