Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
include/monitor/qmp-helpers.h | 26 ++++++++++++
monitor/qmp-cmds.c | 74 ++++++++++++++++-------------------
ui/ui-qmp-cmds.c | 41 +++++++++++++++++++
3 files changed, 100 insertions(+), 41 deletions(-)
create mode 100644 include/monitor/qmp-helpers.h
@@ -174,54 +172,48 @@ void qmp_add_client(const char *protocol, const char
*fdname,
bool has_skipauth, bool skipauth, bool has_tls, bool tls,
Error **errp)
{
+ static struct {
+ const char *name;
+ bool (*add_client)(int fd, bool has_skipauth, bool skipauth,
+ bool has_tls, bool tls, Error **errp);
+ } protocol_table[] = {
+ { "spice", qmp_add_client_spice },
+#ifdef CONFIG_VNC
+ { "vnc", qmp_add_client_vnc },
+#endif
+#ifdef CONFIG_DBUS_DISPLAY
+ { "@dbus-display", qmp_add_client_dbus_display },
+#endif
+ };