From 99997823bbbd23aa0cce42e03b49fd8a57222e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= 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') diff --git a/monitor/qmp-cmds.c b/monitor/qmp-cmds.c index 343353e..14e3bee 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" @@ -286,6 +287,18 @@ void qmp_add_client(const char *protocol, const char *fdname, 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) { error_setg(errp, "failed to add client"); -- cgit v1.1