]> git.proxmox.com Git - pve-qemu-kvm.git/commitdiff
add spice socket support
authorAlexandre Derumier <aderumier@odiso.com>
Fri, 21 Jun 2013 08:34:35 +0000 (10:34 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 25 Jun 2013 04:41:03 +0000 (06:41 +0200)
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
debian/control
debian/patches/series
debian/patches/spice-socket.patch [new file with mode: 0644]
debian/rules

index d9867a06498da41e25cecee8e8b47f7dd6a265e7..3373f8c12876f15c8b6c05f68f01b3cb2d686a13 100644 (file)
@@ -2,12 +2,12 @@ Source: pve-qemu-kvm
 Section: admin
 Priority: extra
 Maintainer: Proxmox Support Team <support@proxmox.com>
-Build-Depends: debhelper (>= 5), autotools-dev, libpci-dev, quilt, texinfo, texi2html, libgnutls-dev, libsdl1.2-dev, check, libaio-dev, uuid-dev, librbd-dev (>= 0.48), libiscsi-dev (>= 1.5.0)
+Build-Depends: debhelper (>= 5), autotools-dev, libpci-dev, quilt, texinfo, texi2html, libgnutls-dev, libsdl1.2-dev, check, libaio-dev, uuid-dev, librbd-dev (>= 0.48), libiscsi-dev (>= 1.5.0), libspice-protocol-dev (>= 0.12.5), pve-libspice-server-dev (>= 0.12.3)
 Standards-Version: 3.7.2
 
 Package: pve-qemu-kvm
 Architecture: any
-Depends: iproute, bridge-utils, python, libsdl1.2debian, libaio1, libuuid1, ceph-common (>= 0.48), libiscsi1 (>= 1.5.0), ${shlibs:Depends}, ${misc:Depends}
+Depends: iproute, bridge-utils, python, libsdl1.2debian, libaio1, libuuid1, ceph-common (>= 0.48), libiscsi1 (>= 1.5.0), pve-libspice-server1:amd64 (>= 0.12.3), ${shlibs:Depends}, ${misc:Depends}
 Conflicts: qemu, qemu-kvm, kvm, pve-kvm, pve-qemu-kvm-2.6.18
 Replaces: pve-kvm, pve-qemu-kvm-2.6.18
 Description: Full virtualization on x86 hardware
index 1498e8ca297db1a34d00d6a8c745608d83f8b9cd..68272cb79f027f0ee5a39ab8a239fb5e4cec7076 100644 (file)
@@ -23,3 +23,4 @@ enable-kvm-by-default.patch
 virtio-balloon-fix-query.patch
 set-cpu-model-to-kvm64.patch
 modify-query-machines.patch
+spice-socket.patch
diff --git a/debian/patches/spice-socket.patch b/debian/patches/spice-socket.patch
new file mode 100644 (file)
index 0000000..00175c5
--- /dev/null
@@ -0,0 +1,107 @@
+From ea2bd3a49ab04110cde4e71d9afafcf5d93db909 Mon Sep 17 00:00:00 2001
+From: Alexandre Derumier <aderumier@odiso.com>
+Date: Mon, 8 Apr 2013 12:42:48 +0200
+Subject: [PATCH 1/2] Add spice support for unix socket option
+
+
+Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
+---
+ qemu-options.hx |    5 ++++-
+ ui/spice-core.c |   22 +++++++++++++++++++---
+ 2 files changed, 23 insertions(+), 4 deletions(-)
+
+diff --git a/qemu-options.hx b/qemu-options.hx
+index 06b6e58..37d271a 100644
+--- a/qemu-options.hx
++++ b/qemu-options.hx
+@@ -887,7 +887,7 @@ Enable SDL.
+ ETEXI
+ DEF("spice", HAS_ARG, QEMU_OPTION_spice,
+-    "-spice [port=port][,tls-port=secured-port][,x509-dir=<dir>]\n"
++    "-spice [port=port][,tls-port=secured-port][,unix=<sock>][,x509-dir=<dir>]\n"
+     "       [,x509-key-file=<file>][,x509-key-password=<file>]\n"
+     "       [,x509-cert-file=<file>][,x509-cacert-file=<file>]\n"
+     "       [,x509-dh-key-file=<file>][,addr=addr][,ipv4|ipv6]\n"
+@@ -911,6 +911,9 @@ Enable the spice remote desktop protocol. Valid options are
+ @table @option
++@item unix=<sock>
++Path on which to bind a UNIX socket.
++
+ @item port=<nr>
+ Set the TCP port spice is listening on for plaintext channels.
+diff --git a/ui/spice-core.c b/ui/spice-core.c
+index bcc4199..acc1626 100644
+--- a/ui/spice-core.c
++++ b/ui/spice-core.c
+@@ -39,6 +39,8 @@
+ #include "hw/hw.h"
+ #include "ui/spice-display.h"
++static const int on=1, off=0;
++
+ /* core bits */
+ static SpiceServer *spice_server;
+@@ -428,6 +430,9 @@ static QemuOptsList qemu_spice_opts = {
+             .name = "tls-port",
+             .type = QEMU_OPT_NUMBER,
+         },{
++            .name = "unix",
++            .type = QEMU_OPT_STRING,
++        },{
+             .name = "addr",
+             .type = QEMU_OPT_STRING,
+         },{
+@@ -640,16 +645,18 @@ void qemu_spice_init(void)
+     spice_image_compression_t compression;
+     spice_wan_compression_t wan_compr;
+     bool seamless_migration;
++    const char *unix_socket;
+     qemu_thread_get_self(&me);
+     if (!opts) {
+         return;
+     }
++    unix_socket = qemu_opt_get(opts, "unix");
+     port = qemu_opt_get_number(opts, "port", 0);
+     tls_port = qemu_opt_get_number(opts, "tls-port", 0);
+-    if (!port && !tls_port) {
+-        error_report("neither port nor tls-port specified for spice");
++    if (!port && !tls_port && !unix_socket) {
++        error_report("neither sock, port nor tls-port specified for spice");
+         exit(1);
+     }
+     if (port < 0 || port > 65535) {
+@@ -705,7 +712,6 @@ void qemu_spice_init(void)
+     } else if (qemu_opt_get_bool(opts, "ipv6", 0)) {
+         addr_flags |= SPICE_ADDR_FLAG_IPV6_ONLY;
+     }
+-
+     spice_server = spice_server_new();
+     spice_server_set_addr(spice_server, addr ? addr : "", addr_flags);
+     if (port) {
+@@ -720,6 +726,16 @@ void qemu_spice_init(void)
+                              x509_dh_file,
+                              tls_ciphers);
+     }
++    if (unix_socket) {
++        char *dpy;
++        int lsock;
++        dpy = g_malloc(256);
++        pstrcpy(dpy, 256, unix_socket);
++        Error *local_err = NULL;
++        lsock = unix_listen(unix_socket, dpy, 256, &local_err);
++        setsockopt(lsock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on));
++        spice_server_set_listen_socket_fd(spice_server, lsock);
++    }
+     if (password) {
+         spice_server_set_ticket(spice_server, password, 0, 0, 0);
+     }
+-- 
+1.7.10.4
+
index 762159dded322c8c827d9c9b7fdd32184a11ac56..05acf25a7f240627107305d514d286d496e7c46f 100755 (executable)
@@ -33,7 +33,7 @@ endif
 config.status: configure
        dh_testdir
        # Add here commands to configure the package.
-       ./configure --with-confsuffix="/kvm" --target-list=x86_64-softmmu --prefix=/usr --datadir=/usr/share --docdir=/usr/share/doc/pve-qemu-kvm --sysconfdir=/etc --disable-xen --enable-vnc-tls --enable-sdl --enable-uuid --enable-linux-aio --enable-rbd --enable-libiscsi --disable-smartcard-nss --audio-drv-list="alsa"
+       ./configure --with-confsuffix="/kvm" --target-list=x86_64-softmmu --prefix=/usr --datadir=/usr/share --docdir=/usr/share/doc/pve-qemu-kvm --sysconfdir=/etc --disable-xen --enable-vnc-tls --enable-sdl --enable-uuid --enable-linux-aio --enable-rbd --enable-libiscsi --disable-smartcard-nss --audio-drv-list="alsa" --enable-spice
 
 build: patch build-stamp