diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2014-04-29 09:27:31 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-05-08 10:45:54 +0200 |
commit | a76a2f729aae21c45c7e9eef8d1d80e94d1cc930 (patch) | |
tree | b2550c7d42449af6e316a509c28d233140c1ef97 /ui | |
parent | 4f60af9ac00800d5833f6ec4317535aeaddb1616 (diff) |
spice: fix libvirt snapshots
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 <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/spice-core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c index 68255796d6..d10818a925 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; } |