xref: /qemu/include/ui/qemu-spice.h (revision f7d48052644f3307748f47062728bb3e5f051ffe)
129b0040bSGerd Hoffmann /*
229b0040bSGerd Hoffmann  * Copyright (C) 2010 Red Hat, Inc.
329b0040bSGerd Hoffmann  *
429b0040bSGerd Hoffmann  * This program is free software; you can redistribute it and/or
529b0040bSGerd Hoffmann  * modify it under the terms of the GNU General Public License as
629b0040bSGerd Hoffmann  * published by the Free Software Foundation; either version 2 or
729b0040bSGerd Hoffmann  * (at your option) version 3 of the License.
829b0040bSGerd Hoffmann  *
929b0040bSGerd Hoffmann  * This program is distributed in the hope that it will be useful,
1029b0040bSGerd Hoffmann  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1129b0040bSGerd Hoffmann  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1229b0040bSGerd Hoffmann  * GNU General Public License for more details.
1329b0040bSGerd Hoffmann  *
1429b0040bSGerd Hoffmann  * You should have received a copy of the GNU General Public License
1529b0040bSGerd Hoffmann  * along with this program; if not, see <http://www.gnu.org/licenses/>.
1629b0040bSGerd Hoffmann  */
1729b0040bSGerd Hoffmann 
1829b0040bSGerd Hoffmann #ifndef QEMU_SPICE_H
1929b0040bSGerd Hoffmann #define QEMU_SPICE_H
2029b0040bSGerd Hoffmann 
21*f7d48052SMarc-André Lureau #include "config-host.h"
22*f7d48052SMarc-André Lureau 
2329b0040bSGerd Hoffmann #ifdef CONFIG_SPICE
2429b0040bSGerd Hoffmann 
2529b0040bSGerd Hoffmann #include <spice.h>
2629b0040bSGerd Hoffmann 
271de7afc9SPaolo Bonzini #include "qemu/option.h"
281de7afc9SPaolo Bonzini #include "qemu/config-file.h"
2983c9089eSPaolo Bonzini #include "monitor/monitor.h"
3029b0040bSGerd Hoffmann 
3129b0040bSGerd Hoffmann extern int using_spice;
3229b0040bSGerd Hoffmann 
3329b0040bSGerd Hoffmann void qemu_spice_init(void);
34864401c2SGerd Hoffmann void qemu_spice_input_init(void);
353e313753SGerd Hoffmann void qemu_spice_audio_init(void);
369fa03286SGerd Hoffmann void qemu_spice_display_init(void);
37f1f5f407SDaniel P. Berrange int qemu_spice_display_add_client(int csock, int skipauth, int tls);
3829b0040bSGerd Hoffmann int qemu_spice_add_interface(SpiceBaseInstance *sin);
399fa03286SGerd Hoffmann bool qemu_spice_have_display_interface(QemuConsole *con);
409fa03286SGerd Hoffmann int qemu_spice_add_display_interface(QXLInstance *qxlin, QemuConsole *con);
417572150cSGerd Hoffmann int qemu_spice_set_passwd(const char *passwd,
427572150cSGerd Hoffmann                           bool fail_if_connected, bool disconnect_if_connected);
437572150cSGerd Hoffmann int qemu_spice_set_pw_expire(time_t expires);
44e866e239SGerd Hoffmann int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
45edc5cb1aSYonit Halperin                             const char *subject,
46edc5cb1aSYonit Halperin                             MonitorCompletion cb, void *opaque);
4729b0040bSGerd Hoffmann 
48cb42a870SGerd Hoffmann void do_info_spice_print(Monitor *mon, const QObject *data);
49cb42a870SGerd Hoffmann void do_info_spice(Monitor *mon, QObject **ret_data);
50cb42a870SGerd Hoffmann 
51cd153e2aSGerd Hoffmann CharDriverState *qemu_chr_open_spice_vmc(const char *type);
525a49d3e9SMarc-André Lureau #if SPICE_SERVER_VERSION >= 0x000c02
53cd153e2aSGerd Hoffmann CharDriverState *qemu_chr_open_spice_port(const char *name);
54afd0b409SMarc-André Lureau void qemu_spice_register_ports(void);
55cd153e2aSGerd Hoffmann #else
56cd153e2aSGerd Hoffmann static inline CharDriverState *qemu_chr_open_spice_port(const char *name)
57cd153e2aSGerd Hoffmann { return NULL; }
585a49d3e9SMarc-André Lureau #endif
59cbcc6336SAlon Levy 
6029b0040bSGerd Hoffmann #else  /* CONFIG_SPICE */
6183c9089eSPaolo Bonzini #include "monitor/monitor.h"
6229b0040bSGerd Hoffmann 
6329b0040bSGerd Hoffmann #define using_spice 0
6458ae52a8SGerd Hoffmann #define spice_displays 0
6514da8345SJes Sorensen static inline int qemu_spice_set_passwd(const char *passwd,
6614da8345SJes Sorensen                                         bool fail_if_connected,
6714da8345SJes Sorensen                                         bool disconnect_if_connected)
6814da8345SJes Sorensen {
6914da8345SJes Sorensen     return -1;
7014da8345SJes Sorensen }
7114da8345SJes Sorensen static inline int qemu_spice_set_pw_expire(time_t expires)
7214da8345SJes Sorensen {
7314da8345SJes Sorensen     return -1;
7414da8345SJes Sorensen }
75edc5cb1aSYonit Halperin static inline int qemu_spice_migrate_info(const char *h, int p, int t,
76edc5cb1aSYonit Halperin                                           const char *s,
77edc5cb1aSYonit Halperin                                           MonitorCompletion cb, void *opaque)
78edc5cb1aSYonit Halperin {
79edc5cb1aSYonit Halperin     cb(opaque, NULL);
80edc5cb1aSYonit Halperin     return -1;
81edc5cb1aSYonit Halperin }
8229b0040bSGerd Hoffmann 
83f1f5f407SDaniel P. Berrange static inline int qemu_spice_display_add_client(int csock, int skipauth,
84f1f5f407SDaniel P. Berrange                                                 int tls)
85f1f5f407SDaniel P. Berrange {
86f1f5f407SDaniel P. Berrange     return -1;
87f1f5f407SDaniel P. Berrange }
88f1f5f407SDaniel P. Berrange 
8929b0040bSGerd Hoffmann #endif /* CONFIG_SPICE */
9029b0040bSGerd Hoffmann 
9129b0040bSGerd Hoffmann #endif /* QEMU_SPICE_H */
92