Commit fa170096 authored by Alon Levy's avatar Alon Levy

xspice: add most options existing in qemu

Add (copy from ui/spice-core.c) most of the options from qemu for
spice server. Notable exception is per channel port selection, so
the only sure way to verify all channels use the secure port (or
the normal one) is to not set the port (or not set the secure port).

About options: All options are settable either from environment
variables called XSPICE_SOMETHING or by a SpiceSomething parameter
in the Device section of the xorg configuration file. The xspice wrapper
added later makes use of those environment variables and gives a
more standard command line parameter interface.
parent e289df20
......@@ -61,6 +61,8 @@ spiceqxl_drv_la_LIBADD = uxa/libuxa.la
spiceqxl_drv_la_SOURCES = \
qxl.h \
spiceqxl_spice_server.c \
spiceqxl_spice_server.h \
spiceqxl_io_port.c \
spiceqxl_driver.c \
spiceqxl_main_loop.c \
......
......@@ -101,6 +101,27 @@ typedef struct qxl_surface_t qxl_surface_t;
enum {
#ifdef XSPICE
OPTION_SPICE_PORT = 0,
OPTION_SPICE_TLS_PORT,
OPTION_SPICE_ADDR,
OPTION_SPICE_X509_DIR,
OPTION_SPICE_SASL,
OPTION_SPICE_AGENT_MOUSE,
OPTION_SPICE_DISABLE_TICKETING,
OPTION_SPICE_PASSWORD,
OPTION_SPICE_X509_KEY_FILE,
OPTION_SPICE_STREAMING_VIDEO,
OPTION_SPICE_PLAYBACK_COMPRESSION,
OPTION_SPICE_ZLIB_GLZ_WAN_COMPRESSION,
OPTION_SPICE_JPEG_WAN_COMPRESSION,
OPTION_SPICE_IMAGE_COMPRESSION,
OPTION_SPICE_DISABLE_COPY_PASTE,
OPTION_SPICE_IPV4_ONLY,
OPTION_SPICE_IPV6_ONLY,
OPTION_SPICE_X509_CERT_FILE,
OPTION_SPICE_X509_KEY_PASSWORD,
OPTION_SPICE_TLS_CIPHERS,
OPTION_SPICE_CACERT_FILE,
OPTION_SPICE_DH_FILE,
#endif
OPTION_COUNT,
};
......
......@@ -43,6 +43,7 @@
#include "spiceqxl_display.h"
#include "spiceqxl_inputs.h"
#include "spiceqxl_io_port.h"
#include "spiceqxl_spice_server.h"
#endif /* XSPICE */
#if 0
......@@ -52,9 +53,53 @@
const OptionInfoRec DefaultOptions[] = {
#ifdef XSPICE
{ OPTION_SPICE_PORT, "SpicePort", OPTV_INTEGER, {5912}, FALSE },
{ OPTION_SPICE_PORT,
"SpicePort", OPTV_INTEGER, {5900}, FALSE },
{ OPTION_SPICE_TLS_PORT,
"SpiceTlsPort", OPTV_INTEGER, {0}, FALSE},
{ OPTION_SPICE_ADDR,
"SpiceAddr", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_X509_DIR,
"SpiceX509Dir", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_SASL,
"SpiceSasl", OPTV_BOOLEAN, {0}, FALSE},
/* VVV qemu defaults to 1 - not implemented in xspice yet */
{ OPTION_SPICE_AGENT_MOUSE,
"SpiceAgentMouse", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_SPICE_DISABLE_TICKETING,
"SpiceDisableTicketing", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_SPICE_PASSWORD,
"SpicePassword", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_X509_KEY_FILE,
"SpiceX509KeyFile", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_STREAMING_VIDEO,
"SpiceStreamingVideo", OPTV_STRING, {.str="filter"}, FALSE},
{ OPTION_SPICE_PLAYBACK_COMPRESSION,
"SpicePlaybackCompression", OPTV_BOOLEAN, {1}, FALSE},
{ OPTION_SPICE_ZLIB_GLZ_WAN_COMPRESSION,
"SpiceZlibGlzWanCompression", OPTV_STRING, {.str="auto"}, FALSE},
{ OPTION_SPICE_JPEG_WAN_COMPRESSION,
"SpiceJpegWanCompression", OPTV_STRING, {.str="auto"}, FALSE},
{ OPTION_SPICE_IMAGE_COMPRESSION,
"SpiceImageCompression", OPTV_STRING, {.str="auto_glz"}, FALSE},
{ OPTION_SPICE_DISABLE_COPY_PASTE,
"SpiceDisableCopyPaste", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_SPICE_IPV4_ONLY,
"SpiceIPV4Only", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_SPICE_IPV6_ONLY,
"SpiceIPV6Only", OPTV_BOOLEAN, {0}, FALSE},
{ OPTION_SPICE_X509_CERT_FILE,
"SpiceX509CertFile", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_X509_KEY_PASSWORD,
"SpiceX509KeyPassword", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_TLS_CIPHERS,
"SpiceTlsCiphers", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_CACERT_FILE,
"SpiceCacertFile", OPTV_STRING, {0}, FALSE},
{ OPTION_SPICE_DH_FILE,
"SpiceDhFile", OPTV_STRING, {0}, FALSE},
#endif
{ -1, NULL, OPTV_NONE, {0}, FALSE }
{ -1, NULL, OPTV_NONE, {0}, FALSE }
};
int
......@@ -895,15 +940,6 @@ setup_uxa (qxl_screen_t *qxl, ScreenPtr screen)
#ifdef XSPICE
SpiceServer *xspice_get_spice_server(void)
{
static SpiceServer *spice_server;
if (!spice_server) {
spice_server = spice_server_new();
}
return spice_server;
}
static void
spiceqxl_screen_init(int scrnIndex, ScrnInfoPtr pScrn, qxl_screen_t *qxl)
{
......@@ -912,10 +948,7 @@ spiceqxl_screen_init(int scrnIndex, ScrnInfoPtr pScrn, qxl_screen_t *qxl)
// Init spice
if (!qxl->spice_server) {
qxl->spice_server = xspice_get_spice_server();
// some common initialization for all display tests
spice_server_set_port(qxl->spice_server, qxl->options[OPTION_SPICE_PORT].value.num);
spice_server_set_noauth(qxl->spice_server); // TODO - take this from config
// TODO - parse rest of parameters (streaming, compression, jpeg, etc.) from config
xspice_set_spice_server_options(qxl->options);
core = basic_event_loop_init();
spice_server_init(qxl->spice_server, core);
qxl_add_spice_display_interface(qxl);
......
This diff is collapsed.
/*
* Copyright 2011 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/** \file spiceqxl_spice_server.h
* \author Alon Levy <alevy@redhat.com>
*
* spice server helpers for spiceqxl.
*/
#ifndef SPICEQXL_SPICE_SERVER_H
#define SPICEQXL_SPICE_SERVER_H
SpiceServer *xspice_get_spice_server(void);
void xspice_set_spice_server_options(OptionInfoPtr options);
#endif // SPICEQXL_SPICE_SERVER_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment