bnc#847641 Index: virt-manager-0.10.0/ui/vmm-migrate.ui =================================================================== --- virt-manager-0.10.0.orig/ui/vmm-migrate.ui +++ virt-manager-0.10.0/ui/vmm-migrate.ui @@ -296,6 +296,53 @@ + + True + False + 6 + + + True + False + 6 + + + True + False + _Allow unsafe migration: + True + migrate-unsafe + + + False + True + 0 + + + + + True + True + False + False + True + + + False + True + 1 + + + + + + + True + True + 1 + + + True False @@ -408,7 +455,7 @@ True True - 1 + 2 @@ -659,7 +706,7 @@ False True - 2 + 3 Index: virt-manager-0.10.0/virtManager/migrate.py =================================================================== --- virt-manager-0.10.0.orig/virtManager/migrate.py +++ virt-manager-0.10.0/virtManager/migrate.py @@ -147,6 +147,7 @@ class vmmMigrateDialog(vmmGObjectUI): self.widget("migrate-rate").set_value(0) self.widget("migrate-secure").set_active(False) + self.widget("migrate-unsafe").set_active(False) downtime_box = self.widget("migrate-maxdowntime-box") support_downtime = self.vm.support_downtime() @@ -174,6 +175,16 @@ class vmmMigrateDialog(vmmGObjectUI): secure_box.set_sensitive(support_secure) secure_box.set_tooltip_text(secure_tooltip) + unsafe_box = self.widget("migrate-unsafe-box") + support_unsafe = hasattr(libvirt, "VIR_MIGRATE_UNSAFE") + unsafe_tooltip = "" + if not support_unsafe: + unsafe_tooltip = _("Libvirt version does not support unsafe " + "migration.") + + unsafe_box.set_sensitive(support_unsafe) + unsafe_box.set_tooltip_text(unsafe_tooltip) + self.rebuild_dest_rows() def set_state(self, vm): @@ -234,6 +245,9 @@ class vmmMigrateDialog(vmmGObjectUI): def get_config_secure(self): return self.widget("migrate-secure").get_active() + def get_config_unsafe(self): + return self.widget("migrate-unsafe").get_active() + def get_config_max_downtime_enabled(self): return self.widget("migrate-max-downtime").get_sensitive() @@ -456,6 +470,7 @@ class vmmMigrateDialog(vmmGObjectUI): max_downtime = self.get_config_max_downtime() live = not self.get_config_offline() secure = self.get_config_secure() + unsafe = self.get_config_unsafe() uri = self.build_migrate_uri(destconn, srcuri) rate = self.get_config_rate() if rate: @@ -476,7 +491,7 @@ class vmmMigrateDialog(vmmGObjectUI): progWin = vmmAsyncJob(self._async_migrate, [self.vm, destconn, uri, rate, live, secure, - max_downtime], + unsafe, max_downtime], _("Migrating VM '%s'" % self.vm.get_name()), (_("Migrating VM '%s' from %s to %s. " "This may take a while.") % @@ -528,7 +543,7 @@ class vmmMigrateDialog(vmmGObjectUI): def _async_migrate(self, asyncjob, origvm, origdconn, migrate_uri, rate, live, - secure, max_downtime): + secure, unsafe, max_downtime): meter = asyncjob.get_meter() srcconn = util.dup_conn(origvm.conn) @@ -548,6 +563,6 @@ class vmmMigrateDialog(vmmGObjectUI): timer = self.timeout_add(100, self._async_set_max_downtime, vm, max_downtime, current_thread) - vm.migrate(dstconn, migrate_uri, rate, live, secure, meter=meter) + vm.migrate(dstconn, migrate_uri, rate, live, secure, unsafe, meter=meter) if timer: self.idle_add(GLib.source_remove, timer) Index: virt-manager-0.10.0/virtManager/domain.py =================================================================== --- virt-manager-0.10.0.orig/virtManager/domain.py +++ virt-manager-0.10.0/virtManager/domain.py @@ -1269,7 +1269,7 @@ class vmmDomain(vmmLibvirtObject): self._backend.migrateSetMaxDowntime(max_downtime, flag) def migrate(self, destconn, interface=None, rate=0, - live=False, secure=False, meter=None): + live=False, secure=False, unsafe=False, meter=None): self._install_abort = True newname = None @@ -1282,6 +1282,9 @@ class vmmDomain(vmmLibvirtObject): flags |= libvirt.VIR_MIGRATE_PEER2PEER flags |= libvirt.VIR_MIGRATE_TUNNELLED + if unsafe: + flags |= libvirt.VIR_MIGRATE_UNSAFE + logging.debug("Migrating: conn=%s flags=%s dname=%s uri=%s rate=%s", destconn.vmm, flags, newname, interface, rate)