From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEFmc-00043i-7M for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:18:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEFmb-0000MA-5X for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:18:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEFma-0000Lv-TL for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:18:41 -0500 From: Gerd Hoffmann Date: Thu, 22 Jan 2015 12:18:33 +0100 Message-Id: <1421925514-12398-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1421925514-12398-1-git-send-email-kraxel@redhat.com> References: <1421925514-12398-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 1/2] spice: add unix address support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann , Anthony Liguori From: Marc-Andr=C3=A9 Lureau Teach qemu to set up a Spice server with a UNIX socket using the following arguments -spice unix,addr=3Dpath. Signed-off-by: Gerd Hoffmann --- qemu-options.hx | 3 ++- ui/spice-core.c | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 10b9568..85ca3ad 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -953,7 +953,7 @@ DEF("spice", HAS_ARG, QEMU_OPTION_spice, "-spice [port=3Dport][,tls-port=3Dsecured-port][,x509-dir=3D]\n= " " [,x509-key-file=3D][,x509-key-password=3D]\n" " [,x509-cert-file=3D][,x509-cacert-file=3D]\n" - " [,x509-dh-key-file=3D][,addr=3Daddr][,ipv4|ipv6]\n" + " [,x509-dh-key-file=3D][,addr=3Daddr][,ipv4|ipv6|unix]\= n" " [,tls-ciphers=3D]\n" " [,tls-channel=3D[main|display|cursor|inputs|record|playback]= ]\n" " [,plaintext-channel=3D[main|display|cursor|inputs|record|pla= yback]]\n" @@ -982,6 +982,7 @@ Set the IP address spice is listening on. Default is= any address. =20 @item ipv4 @item ipv6 +@item unix Force using the specified IP version. =20 @item password=3D diff --git a/ui/spice-core.c b/ui/spice-core.c index fe705c1..c8f7f18 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -436,6 +436,11 @@ static QemuOptsList qemu_spice_opts =3D { },{ .name =3D "ipv6", .type =3D QEMU_OPT_BOOL, +#ifdef SPICE_ADDR_FLAG_UNIX_ONLY + },{ + .name =3D "unix", + .type =3D QEMU_OPT_BOOL, +#endif },{ .name =3D "password", .type =3D QEMU_OPT_STRING, @@ -708,6 +713,10 @@ void qemu_spice_init(void) addr_flags |=3D SPICE_ADDR_FLAG_IPV4_ONLY; } else if (qemu_opt_get_bool(opts, "ipv6", 0)) { addr_flags |=3D SPICE_ADDR_FLAG_IPV6_ONLY; +#ifdef SPICE_ADDR_FLAG_UNIX_ONLY + } else if (qemu_opt_get_bool(opts, "unix", 0)) { + addr_flags |=3D SPICE_ADDR_FLAG_UNIX_ONLY; +#endif } =20 spice_server =3D spice_server_new(); --=20 1.8.3.1