Fix some errors

This commit is contained in:
Joshua Boniface 2018-06-02 15:34:25 -04:00
parent c5668711fe
commit 982a9a2fd4
1 changed files with 5 additions and 2 deletions

View File

@ -67,11 +67,14 @@ class VMInstance:
# Migrate the VM to a target host
def migrate_vm(self):
self.zk.set(self.zkey + '/status', b'migrate')
print(self.zkey)
self.zk.set(self.zkey + '/state', 'migrate'.encode('ascii'))
dest_conn = libvirt.open('qemu+ssh://%s/system' % target)
if dest_conn == None:
self.zk.set(self.zkey + '/state', 'start'.encode('ascii'))
print('Failed to open connection to qemu+ssh://%s/system' % target)
exit(1)
return
target_dom = self.dom.migrate(dest_conn, libvirt.VIR_MIGRATE_LIVE, None, None, 0)
if target_dom == None: