1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#include "qemu/osdep.h"
21#include "qemu/error-report.h"
22#include "qapi/error.h"
23#include "qapi/qapi-types-ui.h"
24#include "qapi/qapi-commands-ui.h"
25#include "ui/qemu-spice-module.h"
26
27int using_spice;
28
29static void qemu_spice_init_stub(void)
30{
31}
32
33static void qemu_spice_display_init_stub(void)
34{
35
36 error_report("spice support is disabled");
37 abort();
38}
39
40static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
41 const char *s)
42{
43 return -1;
44}
45
46static int qemu_spice_set_passwd_stub(const char *passwd,
47 bool fail_if_connected,
48 bool disconnect_if_connected)
49{
50 return -1;
51}
52
53static int qemu_spice_set_pw_expire_stub(time_t expires)
54{
55 return -1;
56}
57
58static int qemu_spice_display_add_client_stub(int csock, int skipauth,
59 int tls)
60{
61 return -1;
62}
63
64struct QemuSpiceOps qemu_spice = {
65 .init = qemu_spice_init_stub,
66 .display_init = qemu_spice_display_init_stub,
67 .migrate_info = qemu_spice_migrate_info_stub,
68 .set_passwd = qemu_spice_set_passwd_stub,
69 .set_pw_expire = qemu_spice_set_pw_expire_stub,
70 .display_add_client = qemu_spice_display_add_client_stub,
71};
72
73#ifdef CONFIG_SPICE
74
75SpiceInfo *qmp_query_spice(Error **errp)
76{
77 if (!qemu_spice.qmp_query) {
78 SpiceInfo *info = g_new0(SpiceInfo, 1);
79 info->enabled = false;
80 return info;
81 }
82 return qemu_spice.qmp_query(errp);
83}
84
85#endif
86