Refactor libvirt create calls

* minimizes duplicated code for create
 * makes wait_for_destroy happen on shutdown instead of undefine
 * allows for destruction of an instance while leaving the domain
 * uses reset for hard reboot instead of create/destroy
 * makes resume_host_state use new methods instead of hard_reboot
 * makes rescue/unrescue not use hard reboot to recreate domain

Change-Id: I2072f93ad6c889d534b04009671147af653048e7
This commit is contained in:
Vishvananda Ishaya
2012-06-01 01:44:02 +00:00
parent 1579aa2aac
commit cc3b912d76
2 changed files with 23 additions and 8 deletions

View File

@@ -288,6 +288,11 @@ class Domain(object):
self._state = VIR_DOMAIN_SHUTDOWN
self._connection._mark_not_running(self)
def reset(self, flags):
# FIXME: Not handling flags at the moment
self._state = VIR_DOMAIN_RUNNING
self._connection._mark_running(self)
def info(self):
return [self._state,
long(self._def['memory']),