12e31e210SGerd Hoffmann /*
22e31e210SGerd Hoffmann * spice module support, also spice stubs.
32e31e210SGerd Hoffmann *
42e31e210SGerd Hoffmann * Copyright (C) 2010 Red Hat, Inc.
52e31e210SGerd Hoffmann *
62e31e210SGerd Hoffmann * This program is free software; you can redistribute it and/or
72e31e210SGerd Hoffmann * modify it under the terms of the GNU General Public License as
82e31e210SGerd Hoffmann * published by the Free Software Foundation; either version 2 or
92e31e210SGerd Hoffmann * (at your option) version 3 of the License.
102e31e210SGerd Hoffmann *
112e31e210SGerd Hoffmann * This program is distributed in the hope that it will be useful,
122e31e210SGerd Hoffmann * but WITHOUT ANY WARRANTY; without even the implied warranty of
132e31e210SGerd Hoffmann * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
142e31e210SGerd Hoffmann * GNU General Public License for more details.
152e31e210SGerd Hoffmann *
162e31e210SGerd Hoffmann * You should have received a copy of the GNU General Public License
172e31e210SGerd Hoffmann * along with this program; if not, see <http://www.gnu.org/licenses/>.
182e31e210SGerd Hoffmann */
192e31e210SGerd Hoffmann
202e31e210SGerd Hoffmann #include "qemu/osdep.h"
21b192cd1eSGerd Hoffmann #include "qemu/error-report.h"
22*db5732c9SGerd Hoffmann #include "qapi/error.h"
23*db5732c9SGerd Hoffmann #include "qapi/qapi-types-ui.h"
24*db5732c9SGerd Hoffmann #include "qapi/qapi-commands-ui.h"
252e31e210SGerd Hoffmann #include "ui/qemu-spice-module.h"
262e31e210SGerd Hoffmann
272e31e210SGerd Hoffmann int using_spice;
287477477cSGerd Hoffmann
qemu_spice_init_stub(void)2963be30e6SGerd Hoffmann static void qemu_spice_init_stub(void)
3063be30e6SGerd Hoffmann {
3163be30e6SGerd Hoffmann }
3263be30e6SGerd Hoffmann
qemu_spice_display_init_stub(void)33b192cd1eSGerd Hoffmann static void qemu_spice_display_init_stub(void)
34b192cd1eSGerd Hoffmann {
35b192cd1eSGerd Hoffmann /* This must never be called if CONFIG_SPICE is disabled */
36b192cd1eSGerd Hoffmann error_report("spice support is disabled");
37b192cd1eSGerd Hoffmann abort();
38b192cd1eSGerd Hoffmann }
39b192cd1eSGerd Hoffmann
qemu_spice_migrate_info_stub(const char * h,int p,int t,const char * s)407477477cSGerd Hoffmann static int qemu_spice_migrate_info_stub(const char *h, int p, int t,
417477477cSGerd Hoffmann const char *s)
427477477cSGerd Hoffmann {
437477477cSGerd Hoffmann return -1;
447477477cSGerd Hoffmann }
457477477cSGerd Hoffmann
qemu_spice_set_passwd_stub(const char * passwd,bool fail_if_connected,bool disconnect_if_connected)4608ad2626SGerd Hoffmann static int qemu_spice_set_passwd_stub(const char *passwd,
4708ad2626SGerd Hoffmann bool fail_if_connected,
4808ad2626SGerd Hoffmann bool disconnect_if_connected)
4908ad2626SGerd Hoffmann {
5008ad2626SGerd Hoffmann return -1;
5108ad2626SGerd Hoffmann }
5208ad2626SGerd Hoffmann
qemu_spice_set_pw_expire_stub(time_t expires)5308ad2626SGerd Hoffmann static int qemu_spice_set_pw_expire_stub(time_t expires)
5408ad2626SGerd Hoffmann {
5508ad2626SGerd Hoffmann return -1;
5608ad2626SGerd Hoffmann }
5708ad2626SGerd Hoffmann
qemu_spice_display_add_client_stub(int csock,int skipauth,int tls)58864a024cSGerd Hoffmann static int qemu_spice_display_add_client_stub(int csock, int skipauth,
59864a024cSGerd Hoffmann int tls)
60864a024cSGerd Hoffmann {
61864a024cSGerd Hoffmann return -1;
62864a024cSGerd Hoffmann }
63864a024cSGerd Hoffmann
647477477cSGerd Hoffmann struct QemuSpiceOps qemu_spice = {
6563be30e6SGerd Hoffmann .init = qemu_spice_init_stub,
66b192cd1eSGerd Hoffmann .display_init = qemu_spice_display_init_stub,
677477477cSGerd Hoffmann .migrate_info = qemu_spice_migrate_info_stub,
6808ad2626SGerd Hoffmann .set_passwd = qemu_spice_set_passwd_stub,
6908ad2626SGerd Hoffmann .set_pw_expire = qemu_spice_set_pw_expire_stub,
70864a024cSGerd Hoffmann .display_add_client = qemu_spice_display_add_client_stub,
717477477cSGerd Hoffmann };
72*db5732c9SGerd Hoffmann
73*db5732c9SGerd Hoffmann #ifdef CONFIG_SPICE
74*db5732c9SGerd Hoffmann
qmp_query_spice(Error ** errp)75*db5732c9SGerd Hoffmann SpiceInfo *qmp_query_spice(Error **errp)
76*db5732c9SGerd Hoffmann {
77*db5732c9SGerd Hoffmann if (!qemu_spice.qmp_query) {
78*db5732c9SGerd Hoffmann SpiceInfo *info = g_new0(SpiceInfo, 1);
79*db5732c9SGerd Hoffmann info->enabled = false;
80*db5732c9SGerd Hoffmann return info;
81*db5732c9SGerd Hoffmann }
82*db5732c9SGerd Hoffmann return qemu_spice.qmp_query(errp);
83*db5732c9SGerd Hoffmann }
84*db5732c9SGerd Hoffmann
85*db5732c9SGerd Hoffmann #endif
86