Commit fb9cb22e authored by Antoine Millet's avatar Antoine Millet

Implemented VM reset

parent 78659913
......@@ -342,6 +342,19 @@ class Handler(HostHandler):
logger.error(msg)
raise UndefinedDomain(msg)
@libvirt_handler
def vm_reset(self, name):
logger.debug('VM reset %s', name)
try:
self.hypervisor.domains[name].reset()
except libvirt.libvirtError:
logger.exception('Error while resetting VM %s', name)
raise
except KeyError:
msg = 'Cannot reset VM %s because it is not defined' % name
logger.error(msg)
raise UndefinedDomain(msg)
@libvirt_handler
def vm_change_title(self, name, new_title):
logger.debug('VM edit title %s', name)
......
......@@ -242,6 +242,9 @@ class VirtualMachine(object):
def undefine(self):
self.lv_dom.undefine()
def reset(self):
self.lv_dom.reset(0)
@property
def disks(self):
return list(self.iter_disks())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment