From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiK3c-0001iA-Lz for qemu-devel@nongnu.org; Thu, 08 May 2014 04:52:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiK3W-0006Yu-Fk for qemu-devel@nongnu.org; Thu, 08 May 2014 04:52:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiK3W-0006XW-64 for qemu-devel@nongnu.org; Thu, 08 May 2014 04:51:54 -0400 From: Gerd Hoffmann Date: Thu, 8 May 2014 10:51:44 +0200 Message-Id: <1399539104-20468-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1399539104-20468-1-git-send-email-kraxel@redhat.com> References: <1399539104-20468-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/2] spice: fix libvirt snapshots List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori Only notify spice-server about migration events in case we got target host information beforehand. So we kick the seamless spice client migration only in case a actual live migration happens, not when libvirt uses live-migration-to-file for snapshotting. Signed-off-by: Gerd Hoffmann --- ui/spice-core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/spice-core.c b/ui/spice-core.c index 6825579..d10818a 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -48,6 +48,7 @@ static char *auth_passwd; static time_t auth_expires = TIME_MAX; static int spice_migration_completed; static int spice_display_is_running; +static int spice_have_target_host; int using_spice = 0; static QemuThread me; @@ -564,12 +565,18 @@ static void migration_state_notifier(Notifier *notifier, void *data) { MigrationState *s = data; + if (!spice_have_target_host) { + return; + } + if (migration_in_setup(s)) { spice_server_migrate_start(spice_server); } else if (migration_has_finished(s)) { spice_server_migrate_end(spice_server, true); + spice_have_target_host = false; } else if (migration_has_failed(s)) { spice_server_migrate_end(spice_server, false); + spice_have_target_host = false; } } @@ -583,6 +590,7 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port, spice_migrate.connect_complete.opaque = opaque; ret = spice_server_migrate_connect(spice_server, hostname, port, tls_port, subject); + spice_have_target_host = true; return ret; } -- 1.8.3.1