From patchwork Fri Oct 8 11:22:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 67180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 92978B6EFF for ; Fri, 8 Oct 2010 22:30:11 +1100 (EST) Received: from localhost ([127.0.0.1]:37160 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4B9M-0006Qp-P5 for incoming@patchwork.ozlabs.org; Fri, 08 Oct 2010 07:30:08 -0400 Received: from [140.186.70.92] (port=47906 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P4B1n-0000hG-MM for qemu-devel@nongnu.org; Fri, 08 Oct 2010 07:22:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P4B1l-0002Rg-He for qemu-devel@nongnu.org; Fri, 08 Oct 2010 07:22:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P4B1l-0002RL-Ah for qemu-devel@nongnu.org; Fri, 08 Oct 2010 07:22:17 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o98BMGGH008499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 8 Oct 2010 07:22:16 -0400 Received: from rincewind.home.kraxel.org (vpn1-5-233.ams2.redhat.com [10.36.5.233]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o98BMBOn001667; Fri, 8 Oct 2010 07:22:14 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id DCAD045573; Fri, 8 Oct 2010 13:22:06 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 8 Oct 2010 13:22:06 +0200 Message-Id: <1286536926-25378-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1286536926-25378-1-git-send-email-kraxel@redhat.com> References: <1286536926-25378-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2 5/5] spice: add misc config options X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This patch adds a few more options to tweak spice server behavior. The documentation update chunk has the details ;) Signed-off-by: Gerd Hoffmann --- qemu-config.c | 9 +++++++++ qemu-options.hx | 9 +++++++++ ui/spice-core.c | 29 ++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletions(-) diff --git a/qemu-config.c b/qemu-config.c index 5a62ae1..52f18be 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -415,6 +415,15 @@ QemuOptsList qemu_spice_opts = { },{ .name = "zlib-glz-wan-compression", .type = QEMU_OPT_STRING, + },{ + .name = "streaming-video", + .type = QEMU_OPT_STRING, + },{ + .name = "agent-mouse", + .type = QEMU_OPT_BOOL, + },{ + .name = "playback-compression", + .type = QEMU_OPT_BOOL, }, { /* end if list */ } }, diff --git a/qemu-options.hx b/qemu-options.hx index 0410b90..9e38dfb 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -728,6 +728,15 @@ Default is auto_glz. Configure wan image compression (lossy for slow links). Default is auto. +@item streaming-video=[off|all|filter] +Configure video stream detection. Default is filter. + +@item agent-mouse=[on|off] +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. + @end table ETEXI diff --git a/ui/spice-core.c b/ui/spice-core.c index 6f613c6..6a1cf17 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -169,6 +169,18 @@ static int parse_name(const char *string, const char *optname, exit(1); } +#if SPICE_SERVER_VERSION >= 0x000600 /* 0.6.0 */ + +static const char *stream_video_names[] = { + [ SPICE_STREAM_VIDEO_OFF ] = "off", + [ SPICE_STREAM_VIDEO_ALL ] = "all", + [ SPICE_STREAM_VIDEO_FILTER ] = "filter", +}; +#define parse_stream_video(_name) \ + name2enum(_name, stream_video_names, ARRAY_SIZE(stream_video_names)) + +#endif /* >= 0.6.0 */ + static const char *compression_names[] = { [ SPICE_IMAGE_COMPRESS_OFF ] = "off", [ SPICE_IMAGE_COMPRESS_AUTO_GLZ ] = "auto_glz", @@ -228,7 +240,7 @@ void qemu_spice_init(void) char *x509_key_file = NULL, *x509_cert_file = NULL, *x509_cacert_file = NULL; - int port, tls_port, len, addr_flags; + int port, tls_port, len, addr_flags, streaming_video; spice_image_compression_t compression; spice_wan_compression_t wan_compr; @@ -328,6 +340,21 @@ void qemu_spice_init(void) } spice_server_set_zlib_glz_compression(spice_server, wan_compr); +#if SPICE_SERVER_VERSION >= 0x000600 /* 0.6.0 */ + + str = qemu_opt_get(opts, "streaming-video"); + if (str) { + streaming_video = parse_stream_video(str); + spice_server_set_streaming_video(spice_server, streaming_video); + } + + spice_server_set_agent_mouse + (spice_server, qemu_opt_get_bool(opts, "agent-mouse", 1)); + spice_server_set_playback_compression + (spice_server, qemu_opt_get_bool(opts, "playback-compression", 1)); + +#endif /* >= 0.6.0 */ + qemu_opt_foreach(opts, add_channel, NULL, 0); spice_server_init(spice_server, &core_interface);