carlwgeorge / rpms / qemu

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