qemu-spice.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2010 Red Hat, Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 or
  7. * (at your option) version 3 of the License.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #ifndef QEMU_SPICE_H
  18. #define QEMU_SPICE_H
  19. #ifdef CONFIG_SPICE
  20. #include <spice.h>
  21. #include "qemu-option.h"
  22. #include "qemu-config.h"
  23. #include "qemu-char.h"
  24. #include "monitor.h"
  25. extern int using_spice;
  26. void qemu_spice_init(void);
  27. void qemu_spice_input_init(void);
  28. void qemu_spice_audio_init(void);
  29. void qemu_spice_display_init(DisplayState *ds);
  30. int qemu_spice_display_add_client(int csock, int skipauth, int tls);
  31. int qemu_spice_add_interface(SpiceBaseInstance *sin);
  32. int qemu_spice_set_passwd(const char *passwd,
  33. bool fail_if_connected, bool disconnect_if_connected);
  34. int qemu_spice_set_pw_expire(time_t expires);
  35. int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
  36. const char *subject,
  37. MonitorCompletion cb, void *opaque);
  38. void do_info_spice_print(Monitor *mon, const QObject *data);
  39. void do_info_spice(Monitor *mon, QObject **ret_data);
  40. CharDriverState *qemu_chr_open_spice(QemuOpts *opts);
  41. #else /* CONFIG_SPICE */
  42. #include "monitor.h"
  43. #define using_spice 0
  44. static inline int qemu_spice_set_passwd(const char *passwd,
  45. bool fail_if_connected,
  46. bool disconnect_if_connected)
  47. {
  48. return -1;
  49. }
  50. static inline int qemu_spice_set_pw_expire(time_t expires)
  51. {
  52. return -1;
  53. }
  54. static inline int qemu_spice_migrate_info(const char *h, int p, int t,
  55. const char *s,
  56. MonitorCompletion cb, void *opaque)
  57. {
  58. cb(opaque, NULL);
  59. return -1;
  60. }
  61. static inline int qemu_spice_display_add_client(int csock, int skipauth,
  62. int tls)
  63. {
  64. return -1;
  65. }
  66. #endif /* CONFIG_SPICE */
  67. #endif /* QEMU_SPICE_H */