diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2020-10-19 09:52:18 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-10-21 15:46:14 +0200 |
commit | db5732c9cfcbf109ff97ee392c285a4675ffe398 (patch) | |
tree | f37563572f830f925eb12429c8ee8315611bcce6 /ui/spice-module.c | |
parent | 864a024c69da2bcf77ecfd0d8bd77f628ded5ba0 (diff) |
spice: wire up monitor in QemuSpiceOps.
Rename qmp_query_spice() to qmp_query_spice_real(), add to QemuSpiceOps.
Add new qmp_query_spice() function which calls the real function via
QemuSpiceOps if available, otherwise return SpiceInfo.enabled = false.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20201019075224.14803-9-kraxel@redhat.com
Diffstat (limited to 'ui/spice-module.c')
-rw-r--r-- | ui/spice-module.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/spice-module.c b/ui/spice-module.c index 8fbc99c03c..3222335872 100644 --- a/ui/spice-module.c +++ b/ui/spice-module.c @@ -19,6 +19,9 @@ #include "qemu/osdep.h" #include "qemu/error-report.h" +#include "qapi/error.h" +#include "qapi/qapi-types-ui.h" +#include "qapi/qapi-commands-ui.h" #include "ui/qemu-spice-module.h" int using_spice; @@ -66,3 +69,17 @@ struct QemuSpiceOps qemu_spice = { .set_pw_expire = qemu_spice_set_pw_expire_stub, .display_add_client = qemu_spice_display_add_client_stub, }; + +#ifdef CONFIG_SPICE + +SpiceInfo *qmp_query_spice(Error **errp) +{ + if (!qemu_spice.qmp_query) { + SpiceInfo *info = g_new0(SpiceInfo, 1); + info->enabled = false; + return info; + } + return qemu_spice.qmp_query(errp); +} + +#endif |