Blame 0206-spice-adding-seamless-migration-option-to-the-comman.patch

Hans de Goede c8dfc6
From 978a72a62c36e932a4b7ae18a5cf23d2d30e9755 Mon Sep 17 00:00:00 2001
Hans de Goede c8dfc6
From: Yonit Halperin <yhalperi@redhat.com>
Hans de Goede c8dfc6
Date: Tue, 21 Aug 2012 11:51:59 +0300
Hans de Goede c8dfc6
Subject: [PATCH 206/215] spice: adding seamless-migration option to the
Hans de Goede c8dfc6
 command line
Hans de Goede c8dfc6
Hans de Goede c8dfc6
The seamless-migration flag is required in order to identify
Hans de Goede c8dfc6
whether libvirt supports the new QEVENT_SPICE_MIGRATE_COMPLETED or not
Hans de Goede c8dfc6
(by default the flag is off).
Hans de Goede c8dfc6
New libvirt versions that wait for QEVENT_SPICE_MIGRATE_COMPLETED should turn on this flag.
Hans de Goede c8dfc6
When this flag is off, spice fallbacks to its old migration method, which
Hans de Goede c8dfc6
can result in data loss.
Hans de Goede c8dfc6
Hans de Goede c8dfc6
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Hans de Goede c8dfc6
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Hans de Goede c8dfc6
---
Hans de Goede c8dfc6
 qemu-config.c   | 3 +++
Hans de Goede c8dfc6
 qemu-options.hx | 3 +++
Hans de Goede c8dfc6
 ui/spice-core.c | 7 +++++++
Hans de Goede c8dfc6
 3 files changed, 13 insertions(+)
Hans de Goede c8dfc6
Hans de Goede c8dfc6
diff --git a/qemu-config.c b/qemu-config.c
Hans de Goede c8dfc6
index 238390e..3eaee48 100644
Hans de Goede c8dfc6
--- a/qemu-config.c
Hans de Goede c8dfc6
+++ b/qemu-config.c
Hans de Goede c8dfc6
@@ -541,6 +541,9 @@ QemuOptsList qemu_spice_opts = {
Hans de Goede c8dfc6
         },{
Hans de Goede c8dfc6
             .name = "playback-compression",
Hans de Goede c8dfc6
             .type = QEMU_OPT_BOOL,
Hans de Goede c8dfc6
+        }, {
Hans de Goede c8dfc6
+            .name = "seamless-migration",
Hans de Goede c8dfc6
+            .type = QEMU_OPT_BOOL,
Hans de Goede c8dfc6
         },
Hans de Goede c8dfc6
         { /* end of list */ }
Hans de Goede c8dfc6
     },
Hans de Goede c8dfc6
diff --git a/qemu-options.hx b/qemu-options.hx
Hans de Goede c8dfc6
index ea06324..dd7aa63 100644
Hans de Goede c8dfc6
--- a/qemu-options.hx
Hans de Goede c8dfc6
+++ b/qemu-options.hx
Hans de Goede c8dfc6
@@ -920,6 +920,9 @@ Enable/disable passing mouse events via vdagent.  Default is on.
Hans de Goede c8dfc6
 @item playback-compression=[on|off]
Hans de Goede c8dfc6
 Enable/disable audio stream compression (using celt 0.5.1).  Default is on.
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
+@item seamless-migration=[on|off]
Hans de Goede c8dfc6
+Enable/disable spice seamless migration. Default is off.
Hans de Goede c8dfc6
+
Hans de Goede c8dfc6
 @end table
Hans de Goede c8dfc6
 ETEXI
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
diff --git a/ui/spice-core.c b/ui/spice-core.c
Hans de Goede c8dfc6
index ab069c5..ba0d0bd 100644
Hans de Goede c8dfc6
--- a/ui/spice-core.c
Hans de Goede c8dfc6
+++ b/ui/spice-core.c
Hans de Goede c8dfc6
@@ -585,6 +585,9 @@ void qemu_spice_init(void)
Hans de Goede c8dfc6
     int port, tls_port, len, addr_flags;
Hans de Goede c8dfc6
     spice_image_compression_t compression;
Hans de Goede c8dfc6
     spice_wan_compression_t wan_compr;
Hans de Goede c8dfc6
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
Hans de Goede c8dfc6
+    bool seamless_migration;
Hans de Goede c8dfc6
+#endif
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
     qemu_thread_get_self(&me);
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
@@ -728,6 +731,10 @@ void qemu_spice_init(void)
Hans de Goede c8dfc6
     spice_server_set_uuid(spice_server, qemu_uuid);
Hans de Goede c8dfc6
 #endif
Hans de Goede c8dfc6
 
Hans de Goede c8dfc6
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
Hans de Goede c8dfc6
+    seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0);
Hans de Goede c8dfc6
+    spice_server_set_seamless_migration(spice_server, seamless_migration);
Hans de Goede c8dfc6
+#endif
Hans de Goede c8dfc6
     if (0 != spice_server_init(spice_server, &core_interface)) {
Hans de Goede c8dfc6
         error_report("failed to initialize spice server");
Hans de Goede c8dfc6
         exit(1);
Hans de Goede c8dfc6
-- 
Hans de Goede c8dfc6
1.7.12
Hans de Goede c8dfc6