|
Hans de Goede |
64c339 |
From be955ad2a04cb7be9b5f34cd0e43d29f34113c6e Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
64c339 |
From: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
64c339 |
Date: Mon, 24 Sep 2012 10:23:40 +0200
|
|
Hans de Goede |
64c339 |
Subject: [PATCH 517/647] spice: raise requirement to 0.12
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
With the next qemu version (1.3) we are going to bump the qxl device
|
|
Hans de Goede |
64c339 |
revision to 4. The new features available require a recent spice-server
|
|
Hans de Goede |
64c339 |
version, so raise up the bar. Otherwise we would end up with different
|
|
Hans de Goede |
64c339 |
qxl revisions depending on the spice-server version installed, which
|
|
Hans de Goede |
64c339 |
would be a major PITA when it comes to compat properties.
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
Clear out a big bunch of #ifdefs which are not needed any more.
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
64c339 |
---
|
|
Hans de Goede |
64c339 |
configure | 18 ++----------------
|
|
Hans de Goede |
64c339 |
hw/qxl.c | 30 ------------------------------
|
|
Hans de Goede |
64c339 |
ui/spice-core.c | 51 ++-------------------------------------------------
|
|
Hans de Goede |
64c339 |
ui/spice-display.c | 38 --------------------------------------
|
|
Hans de Goede |
64c339 |
ui/spice-display.h | 5 -----
|
|
Hans de Goede |
64c339 |
5 files changed, 4 insertions(+), 138 deletions(-)
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
diff --git a/configure b/configure
|
|
Hans de Goede |
64c339 |
index ebe8b1c..b843d20 100755
|
|
Hans de Goede |
64c339 |
--- a/configure
|
|
Hans de Goede |
64c339 |
+++ b/configure
|
|
Hans de Goede |
64c339 |
@@ -2705,20 +2705,14 @@ int main(void) { spice_server_new(); return 0; }
|
|
Hans de Goede |
64c339 |
EOF
|
|
Hans de Goede |
64c339 |
spice_cflags=$($pkg_config --cflags spice-protocol spice-server 2>/dev/null)
|
|
Hans de Goede |
64c339 |
spice_libs=$($pkg_config --libs spice-protocol spice-server 2>/dev/null)
|
|
Hans de Goede |
64c339 |
- if $pkg_config --atleast-version=0.8.2 spice-server >/dev/null 2>&1 && \
|
|
Hans de Goede |
64c339 |
- $pkg_config --atleast-version=0.8.1 spice-protocol > /dev/null 2>&1 && \
|
|
Hans de Goede |
64c339 |
+ if $pkg_config --atleast-version=0.12.0 spice-server >/dev/null 2>&1 && \
|
|
Hans de Goede |
64c339 |
+ $pkg_config --atleast-version=0.12.2 spice-protocol > /dev/null 2>&1 && \
|
|
Hans de Goede |
64c339 |
compile_prog "$spice_cflags" "$spice_libs" ; then
|
|
Hans de Goede |
64c339 |
spice="yes"
|
|
Hans de Goede |
64c339 |
libs_softmmu="$libs_softmmu $spice_libs"
|
|
Hans de Goede |
64c339 |
QEMU_CFLAGS="$QEMU_CFLAGS $spice_cflags"
|
|
Hans de Goede |
64c339 |
spice_protocol_version=$($pkg_config --modversion spice-protocol)
|
|
Hans de Goede |
64c339 |
spice_server_version=$($pkg_config --modversion spice-server)
|
|
Hans de Goede |
64c339 |
- if $pkg_config --atleast-version=0.12.0 spice-protocol >/dev/null 2>&1; then
|
|
Hans de Goede |
64c339 |
- spice_qxl_io_monitors_config_async="yes"
|
|
Hans de Goede |
64c339 |
- fi
|
|
Hans de Goede |
64c339 |
- if $pkg_config --atleast-version=0.12.2 spice-protocol > /dev/null 2>&1; then
|
|
Hans de Goede |
64c339 |
- spice_qxl_client_monitors_config="yes"
|
|
Hans de Goede |
64c339 |
- fi
|
|
Hans de Goede |
64c339 |
else
|
|
Hans de Goede |
64c339 |
if test "$spice" = "yes" ; then
|
|
Hans de Goede |
64c339 |
feature_not_found "spice"
|
|
Hans de Goede |
64c339 |
@@ -3456,14 +3450,6 @@ if test "$spice" = "yes" ; then
|
|
Hans de Goede |
64c339 |
echo "CONFIG_SPICE=y" >> $config_host_mak
|
|
Hans de Goede |
64c339 |
fi
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-if test "$spice_qxl_io_monitors_config_async" = "yes" ; then
|
|
Hans de Goede |
64c339 |
- echo "CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC=y" >> $config_host_mak
|
|
Hans de Goede |
64c339 |
-fi
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
-if test "$spice_qxl_client_monitors_config" = "yes" ; then
|
|
Hans de Goede |
64c339 |
- echo "CONFIG_QXL_CLIENT_MONITORS_CONFIG=y" >> $config_host_mak
|
|
Hans de Goede |
64c339 |
-fi
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
if test "$smartcard" = "yes" ; then
|
|
Hans de Goede |
64c339 |
echo "CONFIG_SMARTCARD=y" >> $config_host_mak
|
|
Hans de Goede |
64c339 |
fi
|
|
Hans de Goede |
64c339 |
diff --git a/hw/qxl.c b/hw/qxl.c
|
|
Hans de Goede |
64c339 |
index 5a9bf1c..255fdf4 100644
|
|
Hans de Goede |
64c339 |
--- a/hw/qxl.c
|
|
Hans de Goede |
64c339 |
+++ b/hw/qxl.c
|
|
Hans de Goede |
64c339 |
@@ -29,11 +29,6 @@
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
#include "qxl.h"
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#ifndef CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC
|
|
Hans de Goede |
64c339 |
-/* spice-protocol is too old, add missing definitions */
|
|
Hans de Goede |
64c339 |
-#define QXL_IO_MONITORS_CONFIG_ASYNC (QXL_IO_FLUSH_RELEASE + 1)
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
/*
|
|
Hans de Goede |
64c339 |
* NOTE: SPICE_RING_PROD_ITEM accesses memory on the pci bar and as
|
|
Hans de Goede |
64c339 |
* such can be changed by the guest, so to avoid a guest trigerrable
|
|
Hans de Goede |
64c339 |
@@ -262,9 +257,6 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
|
|
Hans de Goede |
64c339 |
static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
trace_qxl_spice_monitors_config(qxl->id);
|
|
Hans de Goede |
64c339 |
-/* 0x000b01 == 0.11.1 */
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b01 && \
|
|
Hans de Goede |
64c339 |
- defined(CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC)
|
|
Hans de Goede |
64c339 |
if (replay) {
|
|
Hans de Goede |
64c339 |
/*
|
|
Hans de Goede |
64c339 |
* don't use QXL_COOKIE_TYPE_IO:
|
|
Hans de Goede |
64c339 |
@@ -286,10 +278,6 @@ static void qxl_spice_monitors_config_async(PCIQXLDevice *qxl, int replay)
|
|
Hans de Goede |
64c339 |
(uintptr_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
64c339 |
QXL_IO_MONITORS_CONFIG_ASYNC));
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
- fprintf(stderr, "qxl: too old spice-protocol/spice-server for "
|
|
Hans de Goede |
64c339 |
- "QXL_IO_MONITORS_CONFIG_ASYNC\n");
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
|
|
Hans de Goede |
64c339 |
@@ -948,8 +936,6 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token)
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b04
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
/* called from spice server thread context only */
|
|
Hans de Goede |
64c339 |
static void interface_set_client_capabilities(QXLInstance *sin,
|
|
Hans de Goede |
64c339 |
uint8_t client_present,
|
|
Hans de Goede |
64c339 |
@@ -971,11 +957,6 @@ static void interface_set_client_capabilities(QXLInstance *sin,
|
|
Hans de Goede |
64c339 |
qxl_send_events(qxl, QXL_INTERRUPT_CLIENT);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
-#if defined(CONFIG_QXL_CLIENT_MONITORS_CONFIG) \
|
|
Hans de Goede |
64c339 |
- && SPICE_SERVER_VERSION >= 0x000b05
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
static uint32_t qxl_crc32(const uint8_t *p, unsigned len)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
/*
|
|
Hans de Goede |
64c339 |
@@ -1044,7 +1025,6 @@ static int interface_client_monitors_config(QXLInstance *sin,
|
|
Hans de Goede |
64c339 |
qxl_send_events(qxl, QXL_INTERRUPT_CLIENT_MONITORS_CONFIG);
|
|
Hans de Goede |
64c339 |
return 1;
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
static const QXLInterface qxl_interface = {
|
|
Hans de Goede |
64c339 |
.base.type = SPICE_INTERFACE_QXL,
|
|
Hans de Goede |
64c339 |
@@ -1067,13 +1047,8 @@ static const QXLInterface qxl_interface = {
|
|
Hans de Goede |
64c339 |
.flush_resources = interface_flush_resources,
|
|
Hans de Goede |
64c339 |
.async_complete = interface_async_complete,
|
|
Hans de Goede |
64c339 |
.update_area_complete = interface_update_area_complete,
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b04
|
|
Hans de Goede |
64c339 |
.set_client_capabilities = interface_set_client_capabilities,
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b05 && \
|
|
Hans de Goede |
64c339 |
- defined(CONFIG_QXL_CLIENT_MONITORS_CONFIG)
|
|
Hans de Goede |
64c339 |
.client_monitors_config = interface_client_monitors_config,
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
};
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
static void qxl_enter_vga_mode(PCIQXLDevice *d)
|
|
Hans de Goede |
64c339 |
@@ -1846,7 +1821,6 @@ static void qxl_vm_change_state_handler(void *opaque, int running,
|
|
Hans de Goede |
64c339 |
RunState state)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
PCIQXLDevice *qxl = opaque;
|
|
Hans de Goede |
64c339 |
- qemu_spice_vm_change_state_handler(&qxl->ssd, running, state);
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
if (running) {
|
|
Hans de Goede |
64c339 |
/*
|
|
Hans de Goede |
64c339 |
@@ -1963,14 +1937,10 @@ static int qxl_init_common(PCIQXLDevice *qxl)
|
|
Hans de Goede |
64c339 |
pci_device_rev = QXL_REVISION_STABLE_V10;
|
|
Hans de Goede |
64c339 |
io_size = 32; /* PCI region size must be pow2 */
|
|
Hans de Goede |
64c339 |
break;
|
|
Hans de Goede |
64c339 |
-/* 0x000b01 == 0.11.1 */
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b01 && \
|
|
Hans de Goede |
64c339 |
- defined(CONFIG_QXL_IO_MONITORS_CONFIG_ASYNC)
|
|
Hans de Goede |
64c339 |
case 4: /* qxl-4 */
|
|
Hans de Goede |
64c339 |
pci_device_rev = QXL_REVISION_STABLE_V12;
|
|
Hans de Goede |
64c339 |
io_size = msb_mask(QXL_IO_RANGE_SIZE * 2 - 1);
|
|
Hans de Goede |
64c339 |
break;
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
default:
|
|
Hans de Goede |
64c339 |
error_report("Invalid revision %d for qxl device (max %d)",
|
|
Hans de Goede |
64c339 |
qxl->revision, QXL_DEFAULT_REVISION);
|
|
Hans de Goede |
64c339 |
diff --git a/ui/spice-core.c b/ui/spice-core.c
|
|
Hans de Goede |
64c339 |
index ba0d0bd..5147365 100644
|
|
Hans de Goede |
64c339 |
--- a/ui/spice-core.c
|
|
Hans de Goede |
64c339 |
+++ b/ui/spice-core.c
|
|
Hans de Goede |
64c339 |
@@ -223,7 +223,6 @@ static void channel_event(int event, SpiceChannelEventInfo *info)
|
|
Hans de Goede |
64c339 |
client = qdict_new();
|
|
Hans de Goede |
64c339 |
server = qdict_new();
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT
|
|
Hans de Goede |
64c339 |
if (info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT) {
|
|
Hans de Goede |
64c339 |
add_addr_info(client, (struct sockaddr *)&info->paddr_ext,
|
|
Hans de Goede |
64c339 |
info->plen_ext);
|
|
Hans de Goede |
64c339 |
@@ -232,12 +231,7 @@ static void channel_event(int event, SpiceChannelEventInfo *info)
|
|
Hans de Goede |
64c339 |
} else {
|
|
Hans de Goede |
64c339 |
error_report("spice: %s, extended address is expected",
|
|
Hans de Goede |
64c339 |
__func__);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
- add_addr_info(client, &info->paddr, info->plen);
|
|
Hans de Goede |
64c339 |
- add_addr_info(server, &info->laddr, info->llen);
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
if (event == SPICE_CHANNEL_EVENT_INITIALIZED) {
|
|
Hans de Goede |
64c339 |
qdict_put(server, "auth", qstring_from_str(auth));
|
|
Hans de Goede |
64c339 |
@@ -276,7 +270,6 @@ static SpiceCoreInterface core_interface = {
|
|
Hans de Goede |
64c339 |
.channel_event = channel_event,
|
|
Hans de Goede |
64c339 |
};
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_INTERFACE_MIGRATION
|
|
Hans de Goede |
64c339 |
typedef struct SpiceMigration {
|
|
Hans de Goede |
64c339 |
SpiceMigrateInstance sin;
|
|
Hans de Goede |
64c339 |
struct {
|
|
Hans de Goede |
64c339 |
@@ -313,7 +306,6 @@ static void migrate_end_complete_cb(SpiceMigrateInstance *sin)
|
|
Hans de Goede |
64c339 |
monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL);
|
|
Hans de Goede |
64c339 |
spice_migration_completed = true;
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
/* config string parsing */
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
@@ -393,17 +385,13 @@ static SpiceChannelList *qmp_query_spice_channels(void)
|
|
Hans de Goede |
64c339 |
chan = g_malloc0(sizeof(*chan));
|
|
Hans de Goede |
64c339 |
chan->value = g_malloc0(sizeof(*chan->value));
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT
|
|
Hans de Goede |
64c339 |
if (item->info->flags & SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT) {
|
|
Hans de Goede |
64c339 |
paddr = (struct sockaddr *)&item->info->paddr_ext;
|
|
Hans de Goede |
64c339 |
plen = item->info->plen_ext;
|
|
Hans de Goede |
64c339 |
} else {
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
paddr = &item->info->paddr;
|
|
Hans de Goede |
64c339 |
plen = item->info->plen;
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_CHANNEL_EVENT_FLAG_ADDR_EXT
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
getnameinfo(paddr, plen,
|
|
Hans de Goede |
64c339 |
host, sizeof(host), port, sizeof(port),
|
|
Hans de Goede |
64c339 |
@@ -473,13 +461,10 @@ SpiceInfo *qmp_query_spice(Error **errp)
|
|
Hans de Goede |
64c339 |
info->tls_port = tls_port;
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000a03 /* 0.10.3 */
|
|
Hans de Goede |
64c339 |
info->mouse_mode = spice_server_is_server_mouse(spice_server) ?
|
|
Hans de Goede |
64c339 |
SPICE_QUERY_MOUSE_MODE_SERVER :
|
|
Hans de Goede |
64c339 |
SPICE_QUERY_MOUSE_MODE_CLIENT;
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
- info->mouse_mode = SPICE_QUERY_MOUSE_MODE_UNKNOWN;
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
+
|
|
Hans de Goede |
64c339 |
/* for compatibility with the original command */
|
|
Hans de Goede |
64c339 |
info->has_channels = true;
|
|
Hans de Goede |
64c339 |
info->channels = qmp_query_spice_channels();
|
|
Hans de Goede |
64c339 |
@@ -492,19 +477,11 @@ static void migration_state_notifier(Notifier *notifier, void *data)
|
|
Hans de Goede |
64c339 |
MigrationState *s = data;
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
if (migration_is_active(s)) {
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_INTERFACE_MIGRATION
|
|
Hans de Goede |
64c339 |
spice_server_migrate_start(spice_server);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
} else if (migration_has_finished(s)) {
|
|
Hans de Goede |
64c339 |
-#ifndef SPICE_INTERFACE_MIGRATION
|
|
Hans de Goede |
64c339 |
- spice_server_migrate_switch(spice_server);
|
|
Hans de Goede |
64c339 |
- monitor_protocol_event(QEVENT_SPICE_MIGRATE_COMPLETED, NULL);
|
|
Hans de Goede |
64c339 |
- spice_migration_completed = true;
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
spice_server_migrate_end(spice_server, true);
|
|
Hans de Goede |
64c339 |
} else if (migration_has_failed(s)) {
|
|
Hans de Goede |
64c339 |
spice_server_migrate_end(spice_server, false);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
@@ -513,16 +490,11 @@ int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
|
|
Hans de Goede |
64c339 |
MonitorCompletion *cb, void *opaque)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
int ret;
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_INTERFACE_MIGRATION
|
|
Hans de Goede |
64c339 |
+
|
|
Hans de Goede |
64c339 |
spice_migrate.connect_complete.cb = cb;
|
|
Hans de Goede |
64c339 |
spice_migrate.connect_complete.opaque = opaque;
|
|
Hans de Goede |
64c339 |
ret = spice_server_migrate_connect(spice_server, hostname,
|
|
Hans de Goede |
64c339 |
port, tls_port, subject);
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
- ret = spice_server_migrate_info(spice_server, hostname,
|
|
Hans de Goede |
64c339 |
- port, tls_port, subject);
|
|
Hans de Goede |
64c339 |
- cb(opaque, NULL);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
return ret;
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
@@ -561,7 +533,6 @@ static int add_channel(const char *name, const char *value, void *opaque)
|
|
Hans de Goede |
64c339 |
static void vm_change_state_handler(void *opaque, int running,
|
|
Hans de Goede |
64c339 |
RunState state)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
|
|
Hans de Goede |
64c339 |
if (running) {
|
|
Hans de Goede |
64c339 |
qemu_spice_display_start();
|
|
Hans de Goede |
64c339 |
spice_server_vm_start(spice_server);
|
|
Hans de Goede |
64c339 |
@@ -569,7 +540,6 @@ static void vm_change_state_handler(void *opaque, int running,
|
|
Hans de Goede |
64c339 |
spice_server_vm_stop(spice_server);
|
|
Hans de Goede |
64c339 |
qemu_spice_display_stop();
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
void qemu_spice_init(void)
|
|
Hans de Goede |
64c339 |
@@ -585,9 +555,7 @@ void qemu_spice_init(void)
|
|
Hans de Goede |
64c339 |
int port, tls_port, len, addr_flags;
|
|
Hans de Goede |
64c339 |
spice_image_compression_t compression;
|
|
Hans de Goede |
64c339 |
spice_wan_compression_t wan_compr;
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
|
|
Hans de Goede |
64c339 |
bool seamless_migration;
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
qemu_thread_get_self(&me);
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
@@ -672,16 +640,11 @@ void qemu_spice_init(void)
|
|
Hans de Goede |
64c339 |
spice_server_set_ticket(spice_server, password, 0, 0, 0);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
if (qemu_opt_get_bool(opts, "sasl", 0)) {
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000900 /* 0.9.0 */
|
|
Hans de Goede |
64c339 |
if (spice_server_set_sasl_appname(spice_server, "qemu") == -1 ||
|
|
Hans de Goede |
64c339 |
spice_server_set_sasl(spice_server, 1) == -1) {
|
|
Hans de Goede |
64c339 |
error_report("spice: failed to enable sasl");
|
|
Hans de Goede |
64c339 |
exit(1);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
- error_report("spice: sasl is not available (spice >= 0.9 required)");
|
|
Hans de Goede |
64c339 |
- exit(1);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
if (qemu_opt_get_bool(opts, "disable-ticketing", 0)) {
|
|
Hans de Goede |
64c339 |
auth = "none";
|
|
Hans de Goede |
64c339 |
@@ -726,15 +689,11 @@ void qemu_spice_init(void)
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
qemu_opt_foreach(opts, add_channel, &tls_port, 0);
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000a02 /* 0.10.2 */
|
|
Hans de Goede |
64c339 |
spice_server_set_name(spice_server, qemu_name);
|
|
Hans de Goede |
64c339 |
spice_server_set_uuid(spice_server, qemu_uuid);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b02 /* 0.11.2 */
|
|
Hans de Goede |
64c339 |
seamless_migration = qemu_opt_get_bool(opts, "seamless-migration", 0);
|
|
Hans de Goede |
64c339 |
spice_server_set_seamless_migration(spice_server, seamless_migration);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
if (0 != spice_server_init(spice_server, &core_interface)) {
|
|
Hans de Goede |
64c339 |
error_report("failed to initialize spice server");
|
|
Hans de Goede |
64c339 |
exit(1);
|
|
Hans de Goede |
64c339 |
@@ -743,11 +702,9 @@ void qemu_spice_init(void)
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
migration_state.notify = migration_state_notifier;
|
|
Hans de Goede |
64c339 |
add_migration_state_change_notifier(&migration_state);
|
|
Hans de Goede |
64c339 |
-#ifdef SPICE_INTERFACE_MIGRATION
|
|
Hans de Goede |
64c339 |
spice_migrate.sin.base.sif = &migrate_interface.base;
|
|
Hans de Goede |
64c339 |
spice_migrate.connect_complete.cb = NULL;
|
|
Hans de Goede |
64c339 |
qemu_spice_add_interface(&spice_migrate.sin.base);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
qemu_spice_input_init();
|
|
Hans de Goede |
64c339 |
qemu_spice_audio_init();
|
|
Hans de Goede |
64c339 |
@@ -815,15 +772,11 @@ int qemu_spice_set_pw_expire(time_t expires)
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
int qemu_spice_display_add_client(int csock, int skipauth, int tls)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000a01
|
|
Hans de Goede |
64c339 |
if (tls) {
|
|
Hans de Goede |
64c339 |
return spice_server_add_ssl_client(spice_server, csock, skipauth);
|
|
Hans de Goede |
64c339 |
} else {
|
|
Hans de Goede |
64c339 |
return spice_server_add_client(spice_server, csock, skipauth);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
- return -1;
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
static void spice_register_config(void)
|
|
Hans de Goede |
64c339 |
diff --git a/ui/spice-display.c b/ui/spice-display.c
|
|
Hans de Goede |
64c339 |
index d062765..422e7c4 100644
|
|
Hans de Goede |
64c339 |
--- a/ui/spice-display.c
|
|
Hans de Goede |
64c339 |
+++ b/ui/spice-display.c
|
|
Hans de Goede |
64c339 |
@@ -126,21 +126,6 @@ void qemu_spice_wakeup(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
64c339 |
ssd->worker->wakeup(ssd->worker);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
|
|
Hans de Goede |
64c339 |
-static void qemu_spice_start(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
64c339 |
-{
|
|
Hans de Goede |
64c339 |
- trace_qemu_spice_start(ssd->qxl.id);
|
|
Hans de Goede |
64c339 |
- ssd->worker->start(ssd->worker);
|
|
Hans de Goede |
64c339 |
-}
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
-static void qemu_spice_stop(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
64c339 |
-{
|
|
Hans de Goede |
64c339 |
- trace_qemu_spice_stop(ssd->qxl.id);
|
|
Hans de Goede |
64c339 |
- ssd->worker->stop(ssd->worker);
|
|
Hans de Goede |
64c339 |
-}
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
static int spice_display_is_running;
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
void qemu_spice_display_start(void)
|
|
Hans de Goede |
64c339 |
@@ -153,15 +138,9 @@ void qemu_spice_display_stop(void)
|
|
Hans de Goede |
64c339 |
spice_display_is_running = false;
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
|
|
Hans de Goede |
64c339 |
- return ssd->running;
|
|
Hans de Goede |
64c339 |
-#else
|
|
Hans de Goede |
64c339 |
return spice_display_is_running;
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
static void qemu_spice_create_one_update(SimpleSpiceDisplay *ssd,
|
|
Hans de Goede |
64c339 |
@@ -364,22 +343,6 @@ void qemu_spice_destroy_host_primary(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
64c339 |
qemu_spice_destroy_primary_surface(ssd, 0, QXL_SYNC);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
-void qemu_spice_vm_change_state_handler(void *opaque, int running,
|
|
Hans de Goede |
64c339 |
- RunState state)
|
|
Hans de Goede |
64c339 |
-{
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
|
|
Hans de Goede |
64c339 |
- SimpleSpiceDisplay *ssd = opaque;
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
- if (running) {
|
|
Hans de Goede |
64c339 |
- ssd->running = true;
|
|
Hans de Goede |
64c339 |
- qemu_spice_start(ssd);
|
|
Hans de Goede |
64c339 |
- } else {
|
|
Hans de Goede |
64c339 |
- qemu_spice_stop(ssd);
|
|
Hans de Goede |
64c339 |
- ssd->running = false;
|
|
Hans de Goede |
64c339 |
- }
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
-}
|
|
Hans de Goede |
64c339 |
-
|
|
Hans de Goede |
64c339 |
void qemu_spice_display_init_common(SimpleSpiceDisplay *ssd, DisplayState *ds)
|
|
Hans de Goede |
64c339 |
{
|
|
Hans de Goede |
64c339 |
ssd->ds = ds;
|
|
Hans de Goede |
64c339 |
@@ -623,7 +586,6 @@ void qemu_spice_display_init(DisplayState *ds)
|
|
Hans de Goede |
64c339 |
qemu_spice_add_interface(&sdpy.qxl.base);
|
|
Hans de Goede |
64c339 |
assert(sdpy.worker);
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
- qemu_add_vm_change_state_handler(qemu_spice_vm_change_state_handler, &sdpy);
|
|
Hans de Goede |
64c339 |
qemu_spice_create_host_memslot(&sdpy);
|
|
Hans de Goede |
64c339 |
qemu_spice_create_host_primary(&sdpy);
|
|
Hans de Goede |
64c339 |
}
|
|
Hans de Goede |
64c339 |
diff --git a/ui/spice-display.h b/ui/spice-display.h
|
|
Hans de Goede |
64c339 |
index dea41c1..d766927 100644
|
|
Hans de Goede |
64c339 |
--- a/ui/spice-display.h
|
|
Hans de Goede |
64c339 |
+++ b/ui/spice-display.h
|
|
Hans de Goede |
64c339 |
@@ -83,9 +83,6 @@ struct SimpleSpiceDisplay {
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
QXLRect dirty;
|
|
Hans de Goede |
64c339 |
int notify;
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION < 0x000b02 /* before 0.11.2 */
|
|
Hans de Goede |
64c339 |
- int running;
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
|
|
Hans de Goede |
64c339 |
/*
|
|
Hans de Goede |
64c339 |
* All struct members below this comment can be accessed from
|
|
Hans de Goede |
64c339 |
@@ -133,8 +130,6 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id,
|
|
Hans de Goede |
64c339 |
void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd,
|
|
Hans de Goede |
64c339 |
uint32_t id, qxl_async_io async);
|
|
Hans de Goede |
64c339 |
void qemu_spice_wakeup(SimpleSpiceDisplay *ssd);
|
|
Hans de Goede |
64c339 |
-#if SPICE_SERVER_VERSION >= 0x000b02 /* before 0.11.2 */
|
|
Hans de Goede |
64c339 |
void qemu_spice_display_start(void);
|
|
Hans de Goede |
64c339 |
void qemu_spice_display_stop(void);
|
|
Hans de Goede |
64c339 |
-#endif
|
|
Hans de Goede |
64c339 |
int qemu_spice_display_is_running(SimpleSpiceDisplay *ssd);
|
|
Hans de Goede |
64c339 |
--
|
|
Hans de Goede |
64c339 |
1.7.12.1
|
|
Hans de Goede |
64c339 |
|