From 99997823bbbd23aa0cce42e03b49fd8a57222e5e Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Sun, 10 Oct 2021 00:16:57 +0400 Subject: ui/dbus: add p2p=on/off option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an option to use direct connections instead of via the bus. Clients are accepted with QMP add_client. This allows to provide the D-Bus display without a bus. It also simplifies the testing setup (some CI have issues to setup a D-Bus bus in a container). Signed-off-by: Marc-André Lureau Acked-by: Gerd Hoffmann --- monitor/qmp-cmds.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'monitor/qmp-cmds.c') diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 343353e27a..14e3beeaaf 100644 --- a/monitor/qmp-cmds.c +++ b/monitor/qmp-cmds.c @@ -24,6 +24,7 @@ #include "chardev/char.h" #include "ui/qemu-spice.h" #include "ui/console.h" +#include "ui/dbus-display.h" #include "sysemu/kvm.h" #include "sysemu/runstate.h" #include "sysemu/runstate-action.h" @@ -285,6 +286,18 @@ void qmp_add_client(const char *protocol, const char *fdname, skipauth = has_skipauth ? skipauth : false; vnc_display_add_client(NULL, fd, skipauth); return; +#endif +#ifdef CONFIG_DBUS_DISPLAY + } else if (strcmp(protocol, "@dbus-display") == 0) { + if (!qemu_using_dbus_display(errp)) { + close(fd); + return; + } + if (!qemu_dbus_display.add_client(fd, errp)) { + close(fd); + return; + } + return; #endif } else if ((s = qemu_chr_find(protocol)) != NULL) { if (qemu_chr_add_client(s, fd) < 0) { -- cgit 1.4.1