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:
@@ -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'],
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user