From ccf86c392c5b8949bafd363e44d3abb112578044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 13 Jan 2025 23:31:33 +0400 Subject: ui/dbus: on win32, allow ANONYMOUS with p2p MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GLib doesn't implement EXTERNAL on win32 at the moment, and disables ANONYMOUS by default. zbus dropped support for COOKIE_SHA1 in 5.0, making it no longer possible to connect to qemu -display dbus. Since p2p connections are gated by existing QMP (or a D-Bus connection), qemu -display dbus p2p can accept authentication with ANONYMOUS. Signed-off-by: Marc-André Lureau --- ui/dbus-console.c | 8 +++++++- ui/dbus.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'ui') diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 5eb1d40..85e215e 100644 --- a/ui/dbus-console.c +++ b/ui/dbus-console.c @@ -305,10 +305,16 @@ dbus_console_register_listener(DBusDisplayConsole *ddc, #endif ); + GDBusConnectionFlags flags = + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER; +#ifdef WIN32 + flags |= G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS; +#endif + listener_conn = g_dbus_connection_new_sync( G_IO_STREAM(socket_conn), guid, - G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER, + flags, NULL, NULL, &err); if (err) { error_report("Failed to setup peer connection: %s", err->message); diff --git a/ui/dbus.c b/ui/dbus.c index 7b258c6..2eb03aa 100644 --- a/ui/dbus.c +++ b/ui/dbus.c @@ -317,11 +317,17 @@ dbus_display_add_client(int csock, Error **errp) conn = g_socket_connection_factory_create_connection(socket); dbus_display->add_client_cancellable = g_cancellable_new(); + GDBusConnectionFlags flags = + G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER | + G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING; + +#ifdef WIN32 + flags |= G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS; +#endif g_dbus_connection_new(G_IO_STREAM(conn), guid, - G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_SERVER | - G_DBUS_CONNECTION_FLAGS_DELAY_MESSAGE_PROCESSING, + flags, NULL, dbus_display->add_client_cancellable, dbus_display_add_client_ready, -- cgit v1.1 From 5b4109232e5c6db61fb02aa86b30170d93234acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 14 Jan 2025 14:16:04 +0400 Subject: ui/dbus: clarify the kind of win32 handle that is shared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "-display dbus" hands over a file mapping handle to the peer process (not a file handle). Signed-off-by: Marc-André Lureau --- ui/dbus-display1.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/dbus-display1.xml b/ui/dbus-display1.xml index e70f284..d702253 100644 --- a/ui/dbus-display1.xml +++ b/ui/dbus-display1.xml @@ -527,14 +527,14 @@ -- cgit v1.1 From 19c628f2f579f2702dd13192b7c2de6bc8d665ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Fri, 24 Jan 2025 17:29:24 +0400 Subject: dbus: add -audio dbus nsamples option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow to set the number of audio samples per read/write to dbus. Signed-off-by: Marc-André Lureau --- ui/dbus-display1.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ui') diff --git a/ui/dbus-display1.xml b/ui/dbus-display1.xml index d702253..72deefa 100644 --- a/ui/dbus-display1.xml +++ b/ui/dbus-display1.xml @@ -774,6 +774,18 @@ + + + + +