qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yonit Halperin <yhalperi@redhat.com>
To: qemu-devel@nongnu.org
Cc: mprivozn@redhat.com, Yonit Halperin <yhalperi@redhat.com>,
	kraxel@redhat.com
Subject: [Qemu-devel] [PATCH v3 5/5] spice: adding seamless-migration option to the command line
Date: Tue, 21 Aug 2012 11:51:59 +0300	[thread overview]
Message-ID: <1345539119-26196-6-git-send-email-yhalperi@redhat.com> (raw)
In-Reply-To: <1345539119-26196-1-git-send-email-yhalperi@redhat.com>

The seamless-migration flag is required in order to identify
whether libvirt supports the new QEVENT_SPICE_MIGRATE_COMPLETED or not
(by default the flag is off).
New libvirt versions that wait for QEVENT_SPICE_MIGRATE_COMPLETED should turn on this flag.
When this flag is off, spice fallbacks to its old migration method, which
can result in data loss.

Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
---
 qemu-config.c   |    3 +++
 qemu-options.hx |    3 +++
 ui/spice-core.c |    7 +++++++
 3 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/qemu-config.c b/qemu-config.c
index 5c3296b..b7bb28f 100644
--- a/qemu-config.c
+++ b/qemu-config.c
@@ -524,6 +524,9 @@ QemuOptsList qemu_spice_opts = {
         },{
             .name = "playback-compression",
             .type = QEMU_OPT_BOOL,
+        }, {
+            .name = "seamless-migration",
+            .type = QEMU_OPT_BOOL,
         },
         { /* end of list */ }
     },
diff --git a/qemu-options.hx b/qemu-options.hx
index 47cb5bd..0727f4f 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -917,6 +917,9 @@ Enable/disable passing mouse events via vdagent.  Default is on.
 @item playback-compression=[on|off]
 Enable/disable audio stream compression (using celt 0.5.1).  Default is on.
 
+@item seamless-migration=[on|off]
+Enable/disable spice seamless migration. Default is off.
+
 @end table
 ETEXI
 
diff --git a/ui/spice-core.c b/ui/spice-core.c
index 5d82c8d..d447334 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -584,6 +584,9 @@ void qemu_spice_init(void)
     int port, tls_port, len, addr_flags;
     spice_image_compression_t compression;
     spice_wan_compression_t wan_compr;
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
+    bool seamless_migration;
+#endif
 
     qemu_thread_get_self(&me);
 
@@ -727,6 +730,10 @@ void qemu_spice_init(void)
     spice_server_set_uuid(spice_server, qemu_uuid);
 #endif
 
+#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
+    seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0);
+    spice_server_set_seamless_migration(spice_server, seamless_migration);
+#endif
     if (0 != spice_server_init(spice_server, &core_interface)) {
         error_report("failed to initialize spice server");
         exit(1);
-- 
1.7.7.6

  parent reply	other threads:[~2012-08-21  8:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21  8:51 [Qemu-devel] [PATCH v3 0/5] add support for spice migration v3 Yonit Halperin
2012-08-21  8:51 ` [Qemu-devel] [PATCH v3 1/5] spice: notify spice server on vm start/stop Yonit Halperin
2012-08-21  8:51 ` [Qemu-devel] [PATCH v3 2/5] spice: notify on vm state change only via spice_server_vm_start/stop Yonit Halperin
2012-08-21  8:51 ` [Qemu-devel] [PATCH v3 3/5] spice migration: add QEVENT_SPICE_MIGRATE_COMPLETED Yonit Halperin
2012-08-21 14:09   ` Luiz Capitulino
2012-08-21  8:51 ` [Qemu-devel] [PATCH v3 4/5] spice: add 'migrated' flag to spice info Yonit Halperin
2012-08-21 14:10   ` Luiz Capitulino
2012-08-21  8:51 ` Yonit Halperin [this message]
2012-08-21  9:20 ` [Qemu-devel] [PATCH v3 0/5] add support for spice migration v3 Michal Privoznik
2012-08-21 10:35 ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345539119-26196-6-git-send-email-yhalperi@redhat.com \
    --to=yhalperi@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).