summaryrefslogtreecommitdiffstats
path: root/monitor/qmp-cmds.c
diff options
context:
space:
mode:
authorMarc-André Lureau2021-10-09 22:16:57 +0200
committerMarc-André Lureau2021-12-21 07:50:22 +0100
commit99997823bbbd23aa0cce42e03b49fd8a57222e5e (patch)
tree42969eeb9548b76cd9cdced065c2abccf2b5d189 /monitor/qmp-cmds.c
parentui: add a D-Bus display backend (diff)
downloadqemu-99997823bbbd23aa0cce42e03b49fd8a57222e5e.tar.gz
qemu-99997823bbbd23aa0cce42e03b49fd8a57222e5e.tar.xz
qemu-99997823bbbd23aa0cce42e03b49fd8a57222e5e.zip
ui/dbus: add p2p=on/off option
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 <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'monitor/qmp-cmds.c')
-rw-r--r--monitor/qmp-cmds.c13
1 files changed, 13 insertions, 0 deletions
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"
@@ -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");