qemu-spice.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_add_interface(SpiceBaseInstance *sin);
  31. int qemu_spice_set_passwd(const char *passwd,
  32. bool fail_if_connected, bool disconnect_if_connected);
  33. int qemu_spice_set_pw_expire(time_t expires);
  34. int qemu_spice_migrate_info(const char *hostname, int port, int tls_port,
  35. const char *subject,
  36. MonitorCompletion cb, void *opaque);
  37. void do_info_spice_print(Monitor *mon, const QObject *data);
  38. void do_info_spice(Monitor *mon, QObject **ret_data);
  39. int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr);
  40. #else /* CONFIG_SPICE */
  41. #include "monitor.h"
  42. #define using_spice 0
  43. static inline int qemu_spice_set_passwd(const char *passwd,
  44. bool fail_if_connected,
  45. bool disconnect_if_connected)
  46. {
  47. return -1;
  48. }
  49. static inline int qemu_spice_set_pw_expire(time_t expires)
  50. {
  51. return -1;
  52. }
  53. static inline int qemu_spice_migrate_info(const char *h, int p, int t,
  54. const char *s,
  55. MonitorCompletion cb, void *opaque)
  56. {
  57. cb(opaque, NULL);
  58. return -1;
  59. }
  60. #endif /* CONFIG_SPICE */
  61. #endif /* QEMU_SPICE_H */