#include <netdb.h>
#include "sysemu/sysemu.h"
-#include "qemu-common.h"
#include "ui/qemu-spice.h"
#include "qemu/error-report.h"
#include "qemu/thread.h"
#include "qemu/queue.h"
#include "qemu-x509.h"
#include "qemu/sockets.h"
-#include "qmp-commands.h"
-#include "qapi/qmp/qint.h"
-#include "qapi/qmp/qbool.h"
-#include "qapi/qmp/qstring.h"
-#include "qapi/qmp/qjson.h"
+#include "qapi/error.h"
+#include "qapi/qapi-commands-ui.h"
+#include "qapi/qapi-events-ui.h"
#include "qemu/notify.h"
+#include "qemu/option.h"
#include "migration/misc.h"
#include "hw/hw.h"
#include "ui/spice-display.h"
-#include "qapi-event.h"
/* core bits */
struct SpiceTimer {
QEMUTimer *timer;
- QTAILQ_ENTRY(SpiceTimer) next;
};
-static QTAILQ_HEAD(, SpiceTimer) timers = QTAILQ_HEAD_INITIALIZER(timers);
static SpiceTimer *timer_add(SpiceTimerFunc func, void *opaque)
{
timer = g_malloc0(sizeof(*timer));
timer->timer = timer_new_ms(QEMU_CLOCK_REALTIME, func, opaque);
- QTAILQ_INSERT_TAIL(&timers, timer, next);
return timer;
}
{
timer_del(timer->timer);
timer_free(timer->timer);
- QTAILQ_REMOVE(&timers, timer, next);
g_free(timer);
}
struct SpiceWatch {
int fd;
- int event_mask;
SpiceWatchFunc func;
void *opaque;
- QTAILQ_ENTRY(SpiceWatch) next;
};
-static QTAILQ_HEAD(, SpiceWatch) watches = QTAILQ_HEAD_INITIALIZER(watches);
static void watch_read(void *opaque)
{
IOHandler *on_read = NULL;
IOHandler *on_write = NULL;
- watch->event_mask = event_mask;
- if (watch->event_mask & SPICE_WATCH_EVENT_READ) {
+ if (event_mask & SPICE_WATCH_EVENT_READ) {
on_read = watch_read;
}
- if (watch->event_mask & SPICE_WATCH_EVENT_WRITE) {
+ if (event_mask & SPICE_WATCH_EVENT_WRITE) {
on_write = watch_write;
}
qemu_set_fd_handler(watch->fd, on_read, on_write, watch);
watch->fd = fd;
watch->func = func;
watch->opaque = opaque;
- QTAILQ_INSERT_TAIL(&watches, watch, next);
watch_update_mask(watch, event_mask);
return watch;
static void watch_remove(SpiceWatch *watch)
{
qemu_set_fd_handler(watch->fd, NULL, NULL, NULL);
- QTAILQ_REMOVE(&watches, watch, next);
g_free(watch);
}
switch (event) {
case SPICE_CHANNEL_EVENT_CONNECTED:
qapi_event_send_spice_connected(qapi_SpiceServerInfo_base(server),
- qapi_SpiceChannel_base(client),
- &error_abort);
+ qapi_SpiceChannel_base(client));
break;
case SPICE_CHANNEL_EVENT_INITIALIZED:
if (auth) {
}
add_channel_info(client, info);
channel_list_add(info);
- qapi_event_send_spice_initialized(server, client, &error_abort);
+ qapi_event_send_spice_initialized(server, client);
break;
case SPICE_CHANNEL_EVENT_DISCONNECTED:
channel_list_del(info);
qapi_event_send_spice_disconnected(qapi_SpiceServerInfo_base(server),
- qapi_SpiceChannel_base(client),
- &error_abort);
+ qapi_SpiceChannel_base(client));
break;
default:
break;
static void migrate_end_complete_cb(SpiceMigrateInstance *sin)
{
- qapi_event_send_spice_migrate_completed(&error_abort);
+ qapi_event_send_spice_migrate_completed();
spice_migration_completed = true;
}
"incompatible with -spice port/tls-port");
exit(1);
}
- if (egl_rendernode_init(qemu_opt_get(opts, "rendernode")) != 0) {
+ if (egl_rendernode_init(qemu_opt_get(opts, "rendernode"),
+ DISPLAYGL_MODE_ON) != 0) {
error_report("Failed to initialize EGL render node for SPICE GL");
exit(1);
}