peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

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

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