Commit 5849af23 by Guba Sándor

fixing refactor vmdriver added PAUSE_ON_START flag

parent 5766345e
...@@ -56,7 +56,7 @@ def define(vm): ...@@ -56,7 +56,7 @@ def define(vm):
@req_connection @req_connection
def create(self, vm): def create(vm):
'''Create and start non-permanent virtual machine from xml '''Create and start non-permanent virtual machine from xml
flags can be: flags can be:
VIR_DOMAIN_NONE = 0 VIR_DOMAIN_NONE = 0
...@@ -65,7 +65,7 @@ def create(self, vm): ...@@ -65,7 +65,7 @@ def create(self, vm):
VIR_DOMAIN_START_BYPASS_CACHE = 4 VIR_DOMAIN_START_BYPASS_CACHE = 4
VIR_DOMAIN_START_FORCE_BOOT = 8 VIR_DOMAIN_START_FORCE_BOOT = 8
''' '''
self.connection.createXML(vm.dump_xml(), libvirt.VIR_DOMAIN_NONE) connection.createXML(vm.dump_xml(), libvirt.VIR_DOMAIN_START_PAUSED)
logging.info("Virtual machine %s is created from xml", vm.name) logging.info("Virtual machine %s is created from xml", vm.name)
...@@ -102,41 +102,41 @@ def undefine(name): ...@@ -102,41 +102,41 @@ def undefine(name):
@req_connection @req_connection
def start(self, name): def start(name):
'''Start an already defined virtual machine. '''Start an already defined virtual machine.
''' '''
domain = self.lookupByName(name) domain = lookupByName(name)
domain.create() domain.create()
@req_connection @req_connection
def save(self, name, path): def save(name, path):
'''Stop virtual machine and save its memory to path. '''Stop virtual machine and save its memory to path.
''' '''
domain = self.lookupByName(name) domain = lookupByName(name)
domain.save(path) domain.save(path)
@req_connection @req_connection
def resume(self, name): def resume(name):
'''Resume stopped virtual machines. '''Resume stopped virtual machines.
''' '''
domain = self.lookupByName(name) domain = lookupByName(name)
domain.resume() domain.resume()
@req_connection @req_connection
def reset(self, name): def reset(name):
'''Reset (power reset) virtual machine. '''Reset (power reset) virtual machine.
''' '''
domain = self.lookupByName(name) domain = lookupByName(name)
domain.reset() domain.reset()
@req_connection @req_connection
def reboot(self, name): def reboot(name):
'''Reboot (with guest acpi support) virtual machine. '''Reboot (with guest acpi support) virtual machine.
''' '''
domain = self.lookupByName(name) domain = lookupByName(name)
domain.reboot() domain.reboot()
# virDomainResume # virDomainResume
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 sign in to comment