diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-07-22 19:43:29 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-12-21 10:50:22 +0400 |
commit | 3e301c8d7ef0259c7e19277ea93a9915b55a1c6d (patch) | |
tree | 9baeb150cf45b136e14f958c0262fb528c973833 /ui/dbus.c | |
parent | 4085b87ff0a26e6db7d95a82fcdff861046e6308 (diff) | |
download | qemu-3e301c8d7ef0259c7e19277ea93a9915b55a1c6d.zip qemu-3e301c8d7ef0259c7e19277ea93a9915b55a1c6d.tar.gz qemu-3e301c8d7ef0259c7e19277ea93a9915b55a1c6d.tar.bz2 |
ui/dbus: add chardev backend & interface
Add a new chardev backend which allows D-Bus client to handle the
chardev stream & events.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/dbus.c')
-rw-r--r-- | ui/dbus.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -55,6 +55,27 @@ static const DisplayGLCtxOps dbus_gl_ops = { .dpy_gl_ctx_make_current = qemu_egl_make_context_current, }; +static NotifierList dbus_display_notifiers = + NOTIFIER_LIST_INITIALIZER(dbus_display_notifiers); + +void +dbus_display_notifier_add(Notifier *notifier) +{ + notifier_list_add(&dbus_display_notifiers, notifier); +} + +static void +dbus_display_notifier_remove(Notifier *notifier) +{ + notifier_remove(notifier); +} + +void +dbus_display_notify(DBusDisplayEvent *event) +{ + notifier_list_notify(&dbus_display_notifiers, event); +} + static void dbus_display_init(Object *o) { @@ -73,6 +94,7 @@ dbus_display_init(Object *o) g_dbus_object_manager_server_export(dd->server, vm); dbus_clipboard_init(dd); + dbus_chardev_init(dd); } static void @@ -80,6 +102,10 @@ dbus_display_finalize(Object *o) { DBusDisplay *dd = DBUS_DISPLAY(o); + if (dd->notifier.notify) { + dbus_display_notifier_remove(&dd->notifier); + } + qemu_clipboard_peer_unregister(&dd->clipboard_peer); g_clear_object(&dd->clipboard); |