From patchwork Mon Aug 20 13:26:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yonit Halperin X-Patchwork-Id: 178814 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 689DB2C00B1 for ; Tue, 21 Aug 2012 00:03:12 +1000 (EST) Received: from localhost ([::1]:45829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3Rzt-0004YE-Bu for incoming@patchwork.ozlabs.org; Mon, 20 Aug 2012 09:26:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3Ryr-000253-MU for qemu-devel@nongnu.org; Mon, 20 Aug 2012 09:25:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T3Ryp-0003R7-Gt for qemu-devel@nongnu.org; Mon, 20 Aug 2012 09:25:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42266) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T3Ryp-0003Qq-9O for qemu-devel@nongnu.org; Mon, 20 Aug 2012 09:25:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7KDPIfR019596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Aug 2012 09:25:18 -0400 Received: from dhcp-0-9.tlv.redhat.com (dhcp-4-73.tlv.redhat.com [10.35.4.73]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7KDP2tw010465; Mon, 20 Aug 2012 09:25:17 -0400 From: Yonit Halperin To: qemu-devel@nongnu.org Date: Mon, 20 Aug 2012 16:26:16 +0300 Message-Id: <1345469176-1675-6-git-send-email-yhalperi@redhat.com> In-Reply-To: <1345469176-1675-1-git-send-email-yhalperi@redhat.com> References: <1345469176-1675-1-git-send-email-yhalperi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Yonit Halperin , kraxel@redhat.com Subject: [Qemu-devel] [PATCH v2 5/5] spice: adding seamless-migration option to the command line X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 ad7f01a..08a6da9 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -614,6 +614,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); @@ -757,6 +760,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);