All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/37] Add D-Bus display backend
@ 2021-10-09 21:08 marcandre.lureau
  2021-10-09 21:08 ` [PATCH v2 01/37] build-sys: move Spice configure handling to meson marcandre.lureau
                   ` (37 more replies)
  0 siblings, 38 replies; 54+ messages in thread
From: marcandre.lureau @ 2021-10-09 21:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, kraxel

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Both Spice and VNC are relatively complex and inefficient for local-only
display/console export.

The goal of this display backend is to export over D-Bus an interface close to
the QEMU internal APIs. Any -display or -audio backend should be possible to
implement externally that way. It will allow third-parties to maintain their own
backends (UI toolkits, servers etc), and eventually reduce the responsability on
QEMU.

D-Bus is the protocol of choice for the desktop, it has many convenient bindings
for various languages and tools. Data blob transfer is more efficient than QMP
too. Backends can come and go as needed: you can have several display opened
(say Boxes & virt-manager), while exporting the display over VNC for example
from a different process. It works best on Unix, but there is some Windows
support too (even Windows has some AF_UNIX nowadays, and the WSL2 situation may
change the future of QEMU on Windows anyway).

Using it only requires "-display dbus" on any reasonable Linux desktop with a
D-Bus session bus. Then you use can use busctl, d-feet or gdbus, ex:
$ gdbus introspect --session -r -d org.qemu -o /

See the different patches and documentation for further options. The p2p=on mode
should also allow users running bus-less (on MacOS for ex). We can also add TCP
socket if needed (although more work would be needed in this case to replace
the FD-passing with some extra TCP listening socket).

A WIP Rust/Gtk4 client and VNC server is: https://gitlab.com/marcandre.lureau/qemu-display/
(check README.md for details, then `cargo run` should connect to QEMU)

The Sphinx build support works best with "[PATCH 0/6] Some Sphinx improvements",
where module dependency tracking is improved.

I can resend the first set of preliminary patches after some feedback.

Thanks

v2:
 - rebased
 - drop for the vhost-user-gpu work for now
 - add documentation, including D-Bus Sphinx directive
 - add bus-less option (p2p=on)
 - add some basic tests for the Console/Keyboard interfaces
 - add clipboard sharing support
 - add chardev redirection support (allowing USB redirection, monitors,
   serials...)
 - register a VC handler to export default serial/monitors
 - probably a few bug fixes here and there too

Marc-André Lureau (37):
  build-sys: move Spice configure handling to meson
  ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION
  ui/vdagent: replace #if 0 with protocol version check
  ui: generalize clipboard notifier
  ui/vdagent: add serial capability support
  ui/clipboard: add qemu_clipboard_check_serial()
  ui/clipboard: add a clipboard reset serial event
  hw/display: report an error if virgl initialization failed
  virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP
  ui: do not delay further remote resize
  ui: factor out qemu_console_set_display_gl_ctx()
  ui: associate GL context outside of display listener registration
  ui: make gl_block use a counter
  ui: add a gl-unblock warning timer
  ui: simplify gl unblock & flush
  ui: dispatch GL events to all listeners
  ui: split the GL context in a different object
  ui: move qemu_spice_fill_device_address to ui/util.c
  console: save current scanout details
  scripts: teach modinfo to skip non-C sources
  docs/sphinx: add sphinx modules to include D-Bus documentation
  backends: move dbus-vmstate1.xml to backends/
  docs: move D-Bus VMState documentation to source XML
  docs: add dbus-display documentation
  build-sys: set glib dependency version
  ui: add a D-Bus display backend
  ui/dbus: add p2p=on/off option
  tests/qtests: add qtest_qmp_add_client()
  tests: start dbus-display-test
  audio: add "dbus" audio backend
  ui/dbus: add clipboard interface
  chardev: teach socket to accept no addresses
  chardev: make socket derivable
  option: add g_auto for QemuOpts
  ui/dbus: add chardev backend & interface
  ui/dbus: register D-Bus VC handler
  MAINTAINERS: update D-Bus section

 docs/conf.py                    |   8 +
 docs/interop/dbus-display.rst   |  31 ++
 docs/interop/dbus-vmstate.rst   |  52 +--
 docs/interop/dbus.rst           |   2 +
 docs/interop/index.rst          |   1 +
 docs/sphinx/dbusdoc.py          | 166 +++++++
 docs/sphinx/dbusdomain.py       | 406 +++++++++++++++++
 docs/sphinx/dbusparser.py       | 373 ++++++++++++++++
 docs/sphinx/fakedbusdoc.py      |  25 ++
 configure                       |  49 +-
 meson.build                     |  46 +-
 qapi/audio.json                 |   3 +-
 qapi/char.json                  |  27 ++
 qapi/misc.json                  |   4 +-
 qapi/ui.json                    |  34 +-
 audio/audio_int.h               |   7 +
 audio/audio_template.h          |   2 +
 include/chardev/char-socket.h   |  86 ++++
 include/qemu/cutils.h           |   5 +
 include/qemu/dbus.h             |  24 +
 include/qemu/option.h           |   2 +
 include/ui/clipboard.h          |  55 ++-
 include/ui/console.h            |  70 ++-
 include/ui/dbus-display.h       |  17 +
 include/ui/dbus-module.h        |  11 +
 include/ui/egl-context.h        |   6 +-
 include/ui/gtk.h                |  11 +-
 include/ui/sdl2.h               |   7 +-
 include/ui/spice-display.h      |   5 +-
 tests/qtest/libqos/libqtest.h   |  10 +
 ui/dbus.h                       | 144 ++++++
 audio/audio.c                   |   1 +
 audio/dbusaudio.c               | 654 +++++++++++++++++++++++++++
 chardev/char-socket.c           |  72 +--
 hw/display/qxl.c                |   7 +-
 hw/display/vhost-user-gpu.c     |   2 +-
 hw/display/virtio-gpu-base.c    |   5 +-
 hw/display/virtio-gpu-virgl.c   |   3 +-
 hw/display/virtio-vga.c         |  11 -
 monitor/qmp-cmds.c              |  13 +
 tests/qtest/dbus-display-test.c | 281 ++++++++++++
 tests/qtest/libqtest.c          |  19 +
 ui/clipboard.c                  |  34 +-
 ui/console.c                    | 305 +++++++++----
 ui/dbus-chardev.c               | 296 +++++++++++++
 ui/dbus-clipboard.c             | 457 +++++++++++++++++++
 ui/dbus-console.c               | 497 +++++++++++++++++++++
 ui/dbus-error.c                 |  48 ++
 ui/dbus-listener.c              | 486 ++++++++++++++++++++
 ui/dbus-module.c                |  35 ++
 ui/dbus.c                       | 477 ++++++++++++++++++++
 ui/egl-context.c                |   6 +-
 ui/egl-headless.c               |  20 +-
 ui/gtk-clipboard.c              |  23 +-
 ui/gtk-egl.c                    |  11 +-
 ui/gtk-gl-area.c                |   9 +-
 ui/gtk.c                        |  28 +-
 ui/sdl2-gl.c                    |  12 +-
 ui/sdl2.c                       |  16 +-
 ui/spice-core.c                 |  50 ---
 ui/spice-display.c              |  27 +-
 ui/util.c                       |  75 ++++
 ui/vdagent.c                    |  94 +++-
 ui/vnc-clipboard.c              |  21 +-
 ui/vnc.c                        |   4 +-
 MAINTAINERS                     |  10 +-
 audio/meson.build               |   8 +-
 audio/trace-events              |   5 +
 backends/dbus-vmstate1.xml      |  52 +++
 chardev/meson.build             |   2 +-
 meson_options.txt               |   6 +
 qemu-options.hx                 |  20 +
 scripts/modinfo-collect.py      |   3 +
 tests/qtest/dbus-vmstate1.xml   |  12 -
 tests/qtest/meson.build         |  10 +-
 ui/cocoa.m                      |  20 +-
 ui/dbus-display1.xml            | 761 ++++++++++++++++++++++++++++++++
 ui/meson.build                  |  32 +-
 ui/trace-events                 |  15 +
 79 files changed, 6284 insertions(+), 460 deletions(-)
 create mode 100644 docs/interop/dbus-display.rst
 create mode 100644 docs/sphinx/dbusdoc.py
 create mode 100644 docs/sphinx/dbusdomain.py
 create mode 100644 docs/sphinx/dbusparser.py
 create mode 100644 docs/sphinx/fakedbusdoc.py
 create mode 100644 include/chardev/char-socket.h
 create mode 100644 include/ui/dbus-display.h
 create mode 100644 include/ui/dbus-module.h
 create mode 100644 ui/dbus.h
 create mode 100644 audio/dbusaudio.c
 create mode 100644 tests/qtest/dbus-display-test.c
 create mode 100644 ui/dbus-chardev.c
 create mode 100644 ui/dbus-clipboard.c
 create mode 100644 ui/dbus-console.c
 create mode 100644 ui/dbus-error.c
 create mode 100644 ui/dbus-listener.c
 create mode 100644 ui/dbus-module.c
 create mode 100644 ui/dbus.c
 create mode 100644 ui/util.c
 create mode 100644 backends/dbus-vmstate1.xml
 delete mode 100644 tests/qtest/dbus-vmstate1.xml
 create mode 100644 ui/dbus-display1.xml

-- 
2.33.0.721.g106298f7f9




^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2022-01-11 13:03 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-09 21:08 [PATCH v2 00/37] Add D-Bus display backend marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 01/37] build-sys: move Spice configure handling to meson marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 02/37] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 03/37] ui/vdagent: replace #if 0 with protocol version check marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 04/37] ui: generalize clipboard notifier marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 05/37] ui/vdagent: add serial capability support marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 06/37] ui/clipboard: add qemu_clipboard_check_serial() marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 07/37] ui/clipboard: add a clipboard reset serial event marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 08/37] hw/display: report an error if virgl initialization failed marcandre.lureau
2021-12-17 12:40   ` Philippe Mathieu-Daudé
2021-10-09 21:08 ` [PATCH v2 09/37] virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP marcandre.lureau
2021-12-17 12:51   ` Philippe Mathieu-Daudé
2021-10-09 21:08 ` [PATCH v2 10/37] ui: do not delay further remote resize marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 11/37] ui: factor out qemu_console_set_display_gl_ctx() marcandre.lureau
2021-12-17 13:36   ` Philippe Mathieu-Daudé
2021-10-09 21:08 ` [PATCH v2 12/37] ui: associate GL context outside of display listener registration marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 13/37] ui: make gl_block use a counter marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 14/37] ui: add a gl-unblock warning timer marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 15/37] ui: simplify gl unblock & flush marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 16/37] ui: dispatch GL events to all listeners marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 17/37] ui: split the GL context in a different object marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 18/37] ui: move qemu_spice_fill_device_address to ui/util.c marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 19/37] console: save current scanout details marcandre.lureau
2022-01-11  3:29   ` Akihiko Odaki
2022-01-11  8:23     ` Marc-André Lureau
2022-01-11 12:45       ` Akihiko Odaki
2021-10-09 21:08 ` [PATCH v2 20/37] scripts: teach modinfo to skip non-C sources marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 21/37] docs/sphinx: add sphinx modules to include D-Bus documentation marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 22/37] backends: move dbus-vmstate1.xml to backends/ marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 23/37] docs: move D-Bus VMState documentation to source XML marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 24/37] docs: add dbus-display documentation marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 25/37] build-sys: set glib dependency version marcandre.lureau
2021-12-17 13:27   ` Philippe Mathieu-Daudé
2021-12-17 13:40     ` Marc-André Lureau
2021-12-17 14:36       ` Philippe Mathieu-Daudé
2021-10-09 21:08 ` [PATCH v2 26/37] ui: add a D-Bus display backend marcandre.lureau
2021-10-13  8:59   ` Marc-André Lureau
2021-10-09 21:08 ` [PATCH v2 27/37] ui/dbus: add p2p=on/off option marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 28/37] tests/qtests: add qtest_qmp_add_client() marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 29/37] tests: start dbus-display-test marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 30/37] audio: add "dbus" audio backend marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 31/37] ui/dbus: add clipboard interface marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 32/37] chardev: teach socket to accept no addresses marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 33/37] chardev: make socket derivable marcandre.lureau
2021-12-17 13:32   ` Philippe Mathieu-Daudé
2021-10-09 21:08 ` [PATCH v2 34/37] option: add g_auto for QemuOpts marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 35/37] ui/dbus: add chardev backend & interface marcandre.lureau
2021-10-09 21:08 ` [PATCH v2 36/37] ui/dbus: register D-Bus VC handler marcandre.lureau
2021-12-17 13:35   ` Philippe Mathieu-Daudé
2021-12-17 14:21     ` Marc-André Lureau
2021-10-09 21:08 ` [PATCH v2 37/37] MAINTAINERS: update D-Bus section marcandre.lureau
2021-10-13  5:22 ` [PATCH v2 00/37] Add D-Bus display backend Gerd Hoffmann
2021-12-16 20:53   ` Marc-André Lureau
2021-12-17  7:05     ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.