Adds soft-reboot support to libvirt

* Falls back to hard reboot if guest doesn't respond
 * Cleans up reboot/rescue/unrescue interaction
 * Fixed fake for tests
 * Added a force hard reboot test to verify fallback works
 * Fixes bug 939557

Change-Id: I8d0c9a35725de5e5bfb8f13a2d869c6122ba44ef
This commit is contained in:
Vishvananda Ishaya
2012-02-29 17:29:02 -08:00
parent 3e19fbdc0f
commit 4446f083e8
2 changed files with 9 additions and 1 deletions

View File

@@ -288,8 +288,12 @@ class Domain(object):
def suspend(self):
self._state = VIR_DOMAIN_PAUSED
def shutdown(self):
self._state = VIR_DOMAIN_SHUTDOWN
self._connection._mark_not_running(self)
def info(self):
return [VIR_DOMAIN_RUNNING,
return [self._state,
long(self._def['memory']),
long(self._def['memory']),
self._def['vcpu'],

View File

@@ -476,6 +476,10 @@ class LibvirtConnTestCase(_VirtDriverTestCase):
nova.virt.libvirt.firewall.libvirt = self.saved_libvirt
super(LibvirtConnTestCase, self).tearDown()
def test_force_hard_reboot(self):
self.flags(libvirt_wait_soft_reboot_seconds=0)
self.test_reboot()
@test.skip_test("Test nothing, but this method "
"needed to override superclass.")
def test_migrate_disk_and_power_off(self):