Commit 7e4c2121 by Guba Sándor

fixing decorator to use decorator module properly

parent 647166f2
......@@ -246,4 +246,18 @@ def screenshot(name, path):
finally:
stream.finish()
os.close(fd)
@req_connection
def migrate(name, host, live=False):
'''Migrate domain to host'''
flags = libvirt.VIR_MIGRATE_PEER2PEER
if live:
flags = flags | libvirt.VIR_MIGRATE_LIVE
domain = lookupByName(name)
domain.migrateToURI(
duri="qemu+tcp://" + host + "/system",
flags=flags,
dname=name,
bandwidth=0)
# 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