ui/dbus: compile without gio/gunixfdlist.h

D-Bus on windows doesn't support fd-passing. Let's isolate the
fdlist-related code as a first step, before adding Windows support,
using another mechanism.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20230606115658.677673-4-marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2023-06-06 15:56:40 +04:00
parent 1d48c9fd8e
commit 29c5c7e5f6
4 changed files with 23 additions and 0 deletions

View File

@ -29,7 +29,10 @@
#include "qemu/timer.h"
#include "qemu/dbus.h"
#ifdef G_OS_UNIX
#include <gio/gunixfdlist.h>
#endif
#include "ui/dbus-display1.h"
#define AUDIO_CAP "dbus"
@ -419,6 +422,7 @@ dbus_audio_fini(void *opaque)
g_free(da);
}
#ifdef G_OS_UNIX
static void
listener_out_vanished_cb(GDBusConnection *connection,
gboolean remote_peer_vanished,
@ -591,6 +595,7 @@ dbus_audio_register_in_listener(AudioState *s,
return dbus_audio_register_listener(s, invocation,
fd_list, arg_listener, false);
}
#endif
static void
dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server, bool p2p)
@ -605,12 +610,14 @@ dbus_audio_set_server(AudioState *s, GDBusObjectManagerServer *server, bool p2p)
da->audio = g_dbus_object_skeleton_new(DBUS_DISPLAY1_AUDIO_PATH);
da->iface = qemu_dbus_display1_audio_skeleton_new();
#ifdef G_OS_UNIX
g_object_connect(da->iface,
"swapped-signal::handle-register-in-listener",
dbus_audio_register_in_listener, s,
"swapped-signal::handle-register-out-listener",
dbus_audio_register_out_listener, s,
NULL);
#endif
g_dbus_object_skeleton_add_interface(G_DBUS_OBJECT_SKELETON(da->audio),
G_DBUS_INTERFACE_SKELETON(da->iface));

View File

@ -27,7 +27,9 @@
#include "qemu/config-file.h"
#include "qemu/option.h"
#ifdef G_OS_UNIX
#include <gio/gunixfdlist.h>
#endif
#include "dbus.h"
@ -108,6 +110,7 @@ dbus_chardev_init(DBusDisplay *dpy)
dbus_display_chardev_foreach, dpy);
}
#ifdef G_OS_UNIX
static gboolean
dbus_chr_register(
DBusChardev *dc,
@ -145,6 +148,7 @@ dbus_chr_register(
qemu_dbus_display1_chardev_complete_register(object, invocation, NULL);
return DBUS_METHOD_INVOCATION_HANDLED;
}
#endif
static gboolean
dbus_chr_send_break(
@ -175,8 +179,10 @@ dbus_chr_open(Chardev *chr, ChardevBackend *backend,
dc->iface = qemu_dbus_display1_chardev_skeleton_new();
g_object_set(dc->iface, "name", backend->u.dbus.data->name, NULL);
g_object_connect(dc->iface,
#ifdef G_OS_UNIX
"swapped-signal::handle-register",
dbus_chr_register, dc,
#endif
"swapped-signal::handle-send-break",
dbus_chr_send_break, dc,
NULL);

View File

@ -28,7 +28,9 @@
#include "ui/kbd-state.h"
#include "trace.h"
#ifdef G_OS_UNIX
#include <gio/gunixfdlist.h>
#endif
#include "dbus.h"
@ -163,6 +165,7 @@ dbus_display_console_class_init(DBusDisplayConsoleClass *klass)
gobject_class->dispose = dbus_display_console_dispose;
}
#ifdef G_OS_UNIX
static void
listener_vanished_cb(DBusDisplayListener *listener)
{
@ -174,6 +177,7 @@ listener_vanished_cb(DBusDisplayListener *listener)
g_hash_table_remove(ddc->listeners, name);
qkbd_state_lift_all_keys(ddc->kbd);
}
#endif
static gboolean
dbus_console_set_ui_info(DBusDisplayConsole *ddc,
@ -207,6 +211,7 @@ dbus_console_set_ui_info(DBusDisplayConsole *ddc,
return DBUS_METHOD_INVOCATION_HANDLED;
}
#ifdef G_OS_UNIX
static gboolean
dbus_console_register_listener(DBusDisplayConsole *ddc,
GDBusMethodInvocation *invocation,
@ -282,6 +287,7 @@ dbus_console_register_listener(DBusDisplayConsole *ddc,
trace_dbus_registered_listener(sender);
return DBUS_METHOD_INVOCATION_HANDLED;
}
#endif
static gboolean
dbus_kbd_press(DBusDisplayConsole *ddc,
@ -510,8 +516,10 @@ dbus_display_console_new(DBusDisplay *display, QemuConsole *con)
"device-address", device_addr,
NULL);
g_object_connect(ddc->iface,
#ifdef G_OS_UNIX
"swapped-signal::handle-register-listener",
dbus_console_register_listener, ddc,
#endif
"swapped-signal::handle-set-uiinfo",
dbus_console_set_ui_info, ddc,
NULL);

View File

@ -25,7 +25,9 @@
#include "qemu/error-report.h"
#include "sysemu/sysemu.h"
#include "dbus.h"
#ifdef G_OS_UNIX
#include <gio/gunixfdlist.h>
#endif
#ifdef CONFIG_OPENGL
#include "ui/shader.h"