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
This commit is contained in:
Gerd Hoffmann 2020-10-19 09:52:18 +02:00
parent 864a024c69
commit db5732c9cf
3 changed files with 22 additions and 1 deletions

View file

@ -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