[PULL 22/25] qmp: add 'get-win32-socket'

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau A process with enough capabilities can duplicate a socket to QEMU. Add a QMP command to import it and add it to the monitor fd list, so it can be later used by other commands. Signed-off-by: Marc-André Lureau Acked-by: Markus Armbruster Message-Id: <20230306122751.23555

[PULL v2 07/25] win32/socket: introduce qemu_socket_unselect() helper

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau A more explicit version of qemu_socket_select() with no events. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-8-marcandre.lur...@redhat.com> --- include/sysemu/os-win32.h | 2 ++ io/channel-socket.c | 4 ++-- util

[PULL 12/25] slirp: open-code qemu_socket_(un)select()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau We are about to make the QEMU socket API use file-descriptor space only, but libslirp gives us SOCKET as fd, still. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-14-marcandre.lur...@redhat.com> --- net/slirp.c | 10

[PULL v2 00/25] Win socket patches

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit 29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517: Merge tag 'linux-user-for-8.0-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2023-03-12 10:57:00 +) are available in the Git repository at: https://gitlab.com/ma

[PULL v2 21/25] monitor: release the lock before calling close()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau As per comment, presumably to avoid syscall in critical section. Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros") Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230306122751.2355515-7-marcandre.lur...@redhat.com> --- monitor

[PULL v2 08/25] aio: make aio_set_fd_poll() static to aio-posix.c

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-9-marcandre.lur...@redhat.com> --- include/block/aio.h | 8 util/aio-posix.c| 6 +++--- util/aio-win32.c| 7 --- 3 files changed, 3 insertions(+), 18 del

[PULL v2 19/25] osdep: implement qemu_socketpair() for win32

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Manually implement a socketpair() function, using UNIX sockets and simple peer credential checking. QEMU doesn't make much use of socketpair, beside vhost-user which is not available for win32 at this point. However, I intend to use it for writing some new portable tests.

[PULL v2 20/25] qmp: 'add_client' actually expects sockets

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all actually expect a socket kind or will fail in different ways at runtime. Throw an error early if the given 'add_client' fd is not a socket, and close it to avoid leaks. This allows to replace the close() ca

[PULL v2 03/25] io: use closesocket()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Because they are actually sockets... Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20230221124802.4103554-4-marcandre.lur...@redhat.com> --- io/channel-socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io/channe

[PULL v2 14/25] os-posix: remove useless ioctlsocket() define

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The API is specific to win32. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230221124802.4103554-16-marcandre.lur...@redhat.com> --- include/sysemu/os-posix.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/sysemu/os-posix.h

[PULL v2 09/25] aio/win32: aio_set_fd_handler() only supports SOCKET

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Let's check if the argument is actually a SOCKET, else report an error and return. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-10-marcandre.lur...@redhat.com> --- util/aio-win32.c | 7 ++- 1 file changed, 6 insert

[PULL v2 12/25] slirp: open-code qemu_socket_(un)select()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau We are about to make the QEMU socket API use file-descriptor space only, but libslirp gives us SOCKET as fd, still. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-14-marcandre.lur...@redhat.com> --- net/slirp.c | 10

[PULL v2 24/25] qtest: enable vnc-display test on win32

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Now that qtest_qmp_add_client() works on win32, we can enable the VNC test. Signed-off-by: Marc-André Lureau Acked-by: Thomas Huth Message-Id: <20230306122751.2355515-11-marcandre.lur...@redhat.com> --- tests/qtest/vnc-display-test.c | 12 +++- 1 file changed,

[PULL v2 15/25] win32: replace closesocket() with close() wrapper

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Use a close() wrapper instead, so that we don't need to worry about closesocket() vs close() anymore, let's hope. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-17-marcandre.lur...@redhat.com> --- include/sysemu/os-posix

[PULL v2 01/25] util: drop qemu_fork()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Fortunately, qemu_fork() is no longer used since commit a95570e3e4d6 ("io/command: use glib GSpawn, instead of open-coding fork/exec"). (GSpawn uses posix_spawn() whenever possible instead) Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20

[PULL v2 02/25] tests: use closesocket()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Because they are actually sockets... Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20230221124802.4103554-3-marcandre.lur...@redhat.com> --- tests/unit/socket-helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t

[PULL v2 22/25] qmp: add 'get-win32-socket'

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau A process with enough capabilities can duplicate a socket to QEMU. Add a QMP command to import it and add it to the monitor fd list, so it can be later used by other commands. Signed-off-by: Marc-André Lureau Acked-by: Markus Armbruster Message-Id: <20230306122751.23555

[PULL v2 11/25] slirp: unregister the win32 SOCKET

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Presumably, this is what should happen when the SOCKET is to be removed. (it probably worked until now because closesocket() does it implicitly, but we never now how the slirp library could use the SOCKET later) Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger

[PULL 15/25] win32: replace closesocket() with close() wrapper

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Use a close() wrapper instead, so that we don't need to worry about closesocket() vs close() anymore, let's hope. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-17-marcandre.lur...@redhat.com> --- include/sysemu/os-posix

[PULL 21/25] monitor: release the lock before calling close()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau As per comment, presumably to avoid syscall in critical section. Fixes: 0210c3b39bef08 ("monitor: Use LOCK_GUARD macros") Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230306122751.2355515-7-marcandre.lur...@redhat.com> --- monitor

[PULL v2 13/25] win32: avoid mixing SOCKET and file descriptor space

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Until now, a win32 SOCKET handle is often cast to an int file descriptor, as this is what other OS use for sockets. When necessary, QEMU eventually queries whether it's a socket with the help of fd_is_socket(). However, there is no guarantee of conflict between the fd and

[PULL 04/25] tests: add test-error-report

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-5-marcandre.lur...@redhat.com> --- tests/unit/test-error-report.c | 121 + tests/unit/meson.build | 1 + 2 files changed, 122 insert

[PULL 24/25] qtest: enable vnc-display test on win32

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Now that qtest_qmp_add_client() works on win32, we can enable the VNC test. Signed-off-by: Marc-André Lureau Acked-by: Thomas Huth Message-Id: <20230306122751.2355515-11-marcandre.lur...@redhat.com> --- tests/qtest/vnc-display-test.c | 12 +++- 1 file changed,

[PULL v2 23/25] libqtest: make qtest_qmp_add_client work on win32

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Use the "get-win32-socket" function to pass an opened socket to QEMU, instead of using "getfd", which relies on socket ancillary FD message passing. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230306122751.2355515-10-marcandre.lur...@

[PULL v2 17/25] char: do not double-close fd when failing to add client

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The caller is already closing the fd on failure. Fixes: c3054a6e6a ("char: Factor out qmp_add_client() parts and move to chardev/") Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20230306122751.2355515-3-marc

[PULL v2 18/25] tests/docker: fix a win32 error due to portability

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau docker.py is run during configure, and produces an error: No module named 'pwd'. Use a more portable and recommended alternative to lookup the user "login name". Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230306122751.2355515-4-

[PULL v2 25/25] monitor: restrict command getfd to POSIX hosts

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Currently, the function will simply fail if ancillary fds are not provided, for ex on unsupported platforms. This changes the failure from: {"error": {"class": "GenericError", "desc": "No file descriptor supplied via SCM_RIGHTS"}} to: {"error": {"class": "C

[PULL v2 06/25] win32/socket: introduce qemu_socket_select() helper

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau This is a wrapper for WSAEventSelect, with Error handling. By default, it will produce a warning, so callers don't have to be modified now, and yet we can spot potential mis-use. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.410

[PULL v2 04/25] tests: add test-error-report

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-5-marcandre.lur...@redhat.com> --- tests/unit/test-error-report.c | 121 + tests/unit/meson.build | 1 + 2 files changed, 122 insert

[PULL 07/25] win32/socket: introduce qemu_socket_unselect() helper

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau A more explicit version of qemu_socket_select() with no events. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-8-marcandre.lur...@redhat.com> --- include/sysemu/os-win32.h | 2 ++ io/channel-socket.c | 4 ++-- util

[PULL v2 16/25] tests: fix path separator, use g_build_filename()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20230306122751.2355515-2-marcandre.lur...@redhat.com> --- tests/unit/test-io-channel-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PULL v2 10/25] main-loop: remove qemu_fd_register(), win32/slirp/socket specific

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Open-code the socket registration where it's needed, to avoid artificially used or unclear generic interface. Furthermore, the following patches are going to make socket handling use FD-only inside QEMU, but we need to handle win32 SOCKET from libslirp. Signed-off-by: Ma

[PULL 16/25] tests: fix path separator, use g_build_filename()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20230306122751.2355515-2-marcandre.lur...@redhat.com> --- tests/unit/test-io-channel-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PULL 08/25] aio: make aio_set_fd_poll() static to aio-posix.c

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-9-marcandre.lur...@redhat.com> --- include/block/aio.h | 8 util/aio-posix.c| 6 +++--- util/aio-win32.c| 7 --- 3 files changed, 3 insertions(+), 18 del

[PULL v2 05/25] error: add global &error_warn destination

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau This can help debugging issues or develop, when error handling is introduced. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-6-marcandre.lur...@redhat.com> --- include/qapi/error.h | 6 ++ tests/unit/test-

[PULL 20/25] qmp: 'add_client' actually expects sockets

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Whether it is SPICE, VNC, D-Bus, or the socket chardev, they all actually expect a socket kind or will fail in different ways at runtime. Throw an error early if the given 'add_client' fd is not a socket, and close it to avoid leaks. This allows to replace the close() ca

[PULL 09/25] aio/win32: aio_set_fd_handler() only supports SOCKET

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Let's check if the argument is actually a SOCKET, else report an error and return. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-10-marcandre.lur...@redhat.com> --- util/aio-win32.c | 7 ++- 1 file changed, 6 insert

[PULL 23/25] libqtest: make qtest_qmp_add_client work on win32

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Use the "get-win32-socket" function to pass an opened socket to QEMU, instead of using "getfd", which relies on socket ancillary FD message passing. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230306122751.2355515-10-marcandre.lur...@

[PULL 14/25] os-posix: remove useless ioctlsocket() define

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The API is specific to win32. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20230221124802.4103554-16-marcandre.lur...@redhat.com> --- include/sysemu/os-posix.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/sysemu/os-posix.h

[PULL 06/25] win32/socket: introduce qemu_socket_select() helper

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau This is a wrapper for WSAEventSelect, with Error handling. By default, it will produce a warning, so callers don't have to be modified now, and yet we can spot potential mis-use. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.410

[PULL 10/25] main-loop: remove qemu_fd_register(), win32/slirp/socket specific

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Open-code the socket registration where it's needed, to avoid artificially used or unclear generic interface. Furthermore, the following patches are going to make socket handling use FD-only inside QEMU, but we need to handle win32 SOCKET from libslirp. Signed-off-by: Ma

[PULL 13/25] win32: avoid mixing SOCKET and file descriptor space

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Until now, a win32 SOCKET handle is often cast to an int file descriptor, as this is what other OS use for sockets. When necessary, QEMU eventually queries whether it's a socket with the help of fd_is_socket(). However, there is no guarantee of conflict between the fd and

[PULL 00/25] Win socket patches

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit 29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517: Merge tag 'linux-user-for-8.0-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2023-03-12 10:57:00 +) are available in the Git repository at: https://gitlab.com/ma

[PULL 17/25] char: do not double-close fd when failing to add client

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The caller is already closing the fd on failure. Fixes: c3054a6e6a ("char: Factor out qmp_add_client() parts and move to chardev/") Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Message-Id: <20230306122751.2355515-3-marc

[PULL 11/25] slirp: unregister the win32 SOCKET

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Presumably, this is what should happen when the SOCKET is to be removed. (it probably worked until now because closesocket() does it implicitly, but we never now how the slirp library could use the SOCKET later) Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger

[PULL 02/25] tests: use closesocket()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Because they are actually sockets... Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20230221124802.4103554-3-marcandre.lur...@redhat.com> --- tests/unit/socket-helpers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t

[PULL 05/25] error: add global &error_warn destination

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau This can help debugging issues or develop, when error handling is introduced. Signed-off-by: Marc-André Lureau Reviewed-by: Stefan Berger Message-Id: <20230221124802.4103554-6-marcandre.lur...@redhat.com> --- include/qapi/error.h | 6 ++ tests/unit/test-

[PULL 03/25] io: use closesocket()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Because they are actually sockets... Signed-off-by: Marc-André Lureau Reviewed-by: Thomas Huth Message-Id: <20230221124802.4103554-4-marcandre.lur...@redhat.com> --- io/channel-socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io/channe

[PULL 01/25] util: drop qemu_fork()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Fortunately, qemu_fork() is no longer used since commit a95570e3e4d6 ("io/command: use glib GSpawn, instead of open-coding fork/exec"). (GSpawn uses posix_spawn() whenever possible instead) Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé Message-Id: <20

[PULL 18/18] ui/dbus: restrict opengl to gbm-enabled config

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau We can enable EGL later for non-GBM hosts. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/dbus-listener.c | 10 +- ui/dbus.c | 12 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/dbus-listener.c

[PULL 17/18] ui/dbus: do not require opengl & gbm

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Allow to build & use the DBus display without 3d/GPU acceleration support. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- meson.build | 4 ++-- ui/dbus-listener.c | 15 +-- ui/dbus.c | 8 tests

[PULL 15/18] ui/sdl: try to instantiate the matching opengl renderer

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau -display sdl,gl=es didn't actually use OpenGL ES. Using OpenGL ES allows to use ANGLE, which works generally better than Windows/OEM OpenGL driver. (note: users can still bypass the QEMU choice with SDL_RENDER_DRIVER environment variable) (note: for some reason, specify

[PULL 11/18] ui/sdl: get the GL context from the window

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau There is no guarantee to have a current GL context here. The current code seems to rely on the renderer using a GL backend, and to set a current GL context. But this is not always the case, for example if the renderer backend is DirectX. This change is enough to fix using

[PULL 12/18] ui/shader: fix #version directive must occur on first line

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau ANGLE fails to compile shaders otherwise. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/shader/texture-blit-flip.vert | 1 - ui/shader/texture-blit.frag | 1 - ui/shader/texture-blit.vert | 1 - 3 files changed, 3 deletions(-) diff

[PULL 13/18] ui/egl: print EGL error, helping debugging

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- ui/egl-helpers.c | 54 ++-- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 3a88245b67..b1183741

[PULL 08/18] ui: keep current cursor with QemuConsole

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Keeping the current cursor around is useful, not only for VNC, but for other displays. Let's move it down, see the following patches for other usages. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 1 + ui/vnc.h

[PULL 07/18] ui: rename cursor_{get->ref}, return it

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The naming is more conventional in QEMU code, and allows to simplify some code by changing the API design, so it returns the input parameter, instead of void. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 2 +- ui/cursor.c

[PULL 16/18] ui: introduce egl_init()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Future patches will introduce EGL support on win32 (too late for 8.0 though). Having a common place for EGL initialization and error handling will make it simpler. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/egl-helpers.h | 2 ++ ui

[PULL 14/18] ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Enable SDL logging when QEMU_ENABLE_SDL_LOGGING variable is set, as suggested by Sam Lantinga, upstream SDL maintainer. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/sdl2.c | 4 1 file changed, 4 insertions(+) diff --git a/ui/sdl2.c b/ui

[PULL 09/18] ui: set cursor upon listener registration

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index 0dccbdd4be..7b808f080e 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1662,6 +1662,9 @@ void regi

[PULL 01/18] ui/dbus: initialize cursor_fb

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Or else, we may randomly destroy some textures.. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- include/ui/egl-helpers.h | 2 ++ ui/dbus-listener.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ui/egl-help

[PULL 04/18] ui/dbus: set mouse is-absolute during console creation

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- ui/dbus-console.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 0bfaa2298d..f77bc49d2e 100644 --- a/ui/dbus-console.

[PULL 00/18] UI patches

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The following changes since commit 29c8a9e31a982874ce4e2c15f2bf82d5f8dc3517: Merge tag 'linux-user-for-8.0-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging (2023-03-12 10:57:00 +) are available in the Git repository at: https://gitlab.com/ma

[PULL 10/18] ui: set cursor position upon listener registration

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/console.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/ui/console.c b/ui/console.c index 7b808f080e..8fc18c44bf 100644 --- a/ui/console.c +++ b/ui/console.c @@ -95,6 +95,7 @@ struct Qe

[PULL 05/18] meson: ensure dbus-display generated code is built before other units

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau It's simply by luck that dbus-display header is built first before the other units using it. With sourceset, I can't find an easier way out than declaring an extra dependency for dbus-display1 generate code. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berran

[PULL 06/18] ui: rename cursor_{put->unref}

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The naming is more conventional in QEMU. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h| 2 +- hw/display/qxl-render.c | 4 ++-- hw/display/qxl.c| 2 +- hw/display/vmware_vga.c | 4 ++-- ui/cursor.c | 2

[PULL 03/18] audio/dbus: there are no sender for p2p mode

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- audio/audio_int.h | 2 +- audio/dbusaudio.c | 7 +-- ui/dbus.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index d51d63f08d.

[PULL 02/18] ui/dbus: unregister clipboard on connection close

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Fixes unregistration with p2p connections, since they don't have an associated name owner. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/dbus-clipboard.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/u

[PATCH v3 16/18] ui: introduce egl_init()

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Future patches will introduce EGL support on win32 (too late for 8.0 though). Having a common place for EGL initialization and error handling will make it simpler. Signed-off-by: Marc-André Lureau --- include/ui/egl-helpers.h | 2 ++ ui/dbus.c| 7 +

[PATCH v3 02/18] ui/dbus: unregister clipboard on connection close

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Fixes unregistration with p2p connections, since they don't have an associated name owner. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/dbus-clipboard.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/u

[PATCH v3 17/18] ui/dbus: do not require opengl & gbm

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Allow to build & use the DBus display without 3d/GPU acceleration support. Signed-off-by: Marc-André Lureau --- meson.build | 4 ++-- ui/dbus-listener.c | 15 +-- ui/dbus.c | 8 tests/qtest/meson.build | 2 +- ui/me

[PATCH v3 13/18] ui/egl: print EGL error, helping debugging

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- ui/egl-helpers.c | 54 ++-- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 3a88245b67..b1183741

[PATCH v3 04/18] ui/dbus: set mouse is-absolute during console creation

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- ui/dbus-console.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ui/dbus-console.c b/ui/dbus-console.c index 0bfaa2298d..f77bc49d2e 100644 --- a/ui/dbus-console.

[PATCH v3 12/18] ui/shader: fix #version directive must occur on first line

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau ANGLE fails to compile shaders otherwise. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/shader/texture-blit-flip.vert | 1 - ui/shader/texture-blit.frag | 1 - ui/shader/texture-blit.vert | 1 - 3 files changed, 3 deletions(-) diff

[PATCH v3 08/18] ui: keep current cursor with QemuConsole

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Keeping the current cursor around is useful, not only for VNC, but for other displays. Let's move it down, see the following patches for other usages. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 1 + ui/vnc.h

[PATCH v3 15/18] ui/sdl: try to instantiate the matching opengl renderer

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau -display sdl,gl=es didn't actually use OpenGL ES. Using OpenGL ES allows to use ANGLE, which works generally better than Windows/OEM OpenGL driver. (note: users can still bypass the QEMU choice with SDL_RENDER_DRIVER environment variable) (note: for some reason, specify

[PATCH v3 06/18] ui: rename cursor_{put->unref}

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The naming is more conventional in QEMU. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h| 2 +- hw/display/qxl-render.c | 4 ++-- hw/display/qxl.c| 2 +- hw/display/vmware_vga.c | 4 ++-- ui/cursor.c | 2

[PATCH v3 09/18] ui: set cursor upon listener registration

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index 0dccbdd4be..7b808f080e 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1662,6 +1662,9 @@ void regi

[PATCH v3 14/18] ui/sdl: add QEMU_ENABLE_SDL_LOGGING setting/environment

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Enable SDL logging when QEMU_ENABLE_SDL_LOGGING variable is set, as suggested by Sam Lantinga, upstream SDL maintainer. Signed-off-by: Marc-André Lureau --- ui/sdl2.c | 4 1 file changed, 4 insertions(+) diff --git a/ui/sdl2.c b/ui/sdl2.c index 137f7ab57f..221cdce

[PATCH v3 18/18] ui/dbus: restrict opengl to gbm-enabled config

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau We can enable EGL later for non-GBM hosts. Signed-off-by: Marc-André Lureau --- ui/dbus-listener.c | 10 +- ui/dbus.c | 12 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 85692f

[PATCH v3 07/18] ui: rename cursor_{get->ref}, return it

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau The naming is more conventional in QEMU code, and allows to simplify some code by changing the API design, so it returns the input parameter, instead of void. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 2 +- ui/cursor.c

[PATCH v3 11/18] ui/sdl: get the GL context from the window

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau There is no guarantee to have a current GL context here. The current code seems to rely on the renderer using a GL backend, and to set a current GL context. But this is not always the case, for example if the renderer backend is DirectX. This change is enough to fix using

[PATCH v3 10/18] ui: set cursor position upon listener registration

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- ui/console.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/ui/console.c b/ui/console.c index 7b808f080e..8fc18c44bf 100644 --- a/ui/console.c +++ b/ui/console.c @@ -95,6 +95,7 @@ struct Qe

[PATCH v3 05/18] meson: ensure dbus-display generated code is built before other units

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau It's simply by luck that dbus-display header is built first before the other units using it. With sourceset, I can't find an easier way out than declaring an extra dependency for dbus-display1 generate code. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berran

[PATCH v3 01/18] ui/dbus: initialize cursor_fb

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Or else, we may randomly destroy some textures.. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- include/ui/egl-helpers.h | 2 ++ ui/dbus-listener.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/ui/egl-help

[PATCH v3 03/18] audio/dbus: there are no sender for p2p mode

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- audio/audio_int.h | 2 +- audio/dbusaudio.c | 7 +-- ui/dbus.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index d51d63f08d.

[PATCH v3 00/18] ui: dbus & misc fixes

2023-03-13 Thread marcandre . lureau
From: Marc-André Lureau Hi, This is a respin of a series I sent end of January that didn't get reviews, here is your chance! :) A collection of fixes for UI related-stuff, and paving the way for accelerated/egl dbus display support on win32 (for 8.1 hopefully). I think they are worth to include

[PATCH v3] qapi: give available enum values as error hint

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau This allows for a more pleasant user experience. Before: $ ./qemu-system-x86_64 -display egl-headless,gl= qemu-system-x86_64: -display egl-headless,gl=: Parameter 'gl' does not accept value '' After: $ ./qemu-system-x86_64 -display egl-headless,gl= qemu-system-x86_64: -

[PATCH v2] qapi: give available enum values as error hint

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau This allows for a more pleasant user experience. Before: $ ./qemu-system-x86_64 -display egl-headless,gl= qemu-system-x86_64: -display egl-headless,gl=: Parameter 'gl' does not accept value '' After: $ ./qemu-system-x86_64 -display egl-headless,gl= qemu-system-x86_64: -

[PATCH] .editorconfig: set max line at 70 chars for QAPI files

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau This seems to be the preferred style. The EditorConfig property is not supported by all editors: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length Signed-off-by: Marc-André Lureau --- .editorconfig | 1 + 1 file changed, 1 insert

[PATCH v2 17/18] ui/dbus: do not require opengl & gbm

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau Allow to build & use the DBus display without 3d/GPU acceleration support. Signed-off-by: Marc-André Lureau --- meson.build | 2 -- ui/dbus-listener.c | 15 +-- ui/dbus.c | 8 tests/qtest/meson.build | 2 +- ui/meso

[PATCH v2 18/18] ui/dbus: restrict opengl to gbm-enabled config

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau We can enable EGL later for non-GBM hosts. Signed-off-by: Marc-André Lureau --- ui/dbus-listener.c | 10 +- ui/dbus.c | 12 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 85692f

[PATCH v2 15/18] ui/sdl: try to instantiate the matching opengl renderer

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau User can still bypass the QEMU choice with SDL_RENDER_DRIVER environment variable. (for some reason, specifying a driver disables batching and breaks rendering, so enable it explicitly) Signed-off-by: Marc-André Lureau --- ui/sdl2.c | 11 +++ 1 file changed, 11

[PATCH v2 08/18] ui: keep current cursor with QemuConsole

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau Keeping the current cursor around is useful, not only for VNC, but for other displays. Let's move it down, see the following patches for other usages. Signed-off-by: Marc-André Lureau --- include/ui/console.h | 1 + ui/vnc.h | 1 - ui/console.c | 8 +

[PATCH v2 09/18] ui: set cursor upon listener registration

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau Signed-off-by: Marc-André Lureau --- ui/console.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/console.c b/ui/console.c index 0dccbdd4be..7b808f080e 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1662,6 +1662,9 @@ void register_displaychangelistener(Displa

[PATCH v2 14/18] ui/sdl: add optional logging when _SDL_DEBUG is set

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau Apparently, there is no environment variable you can set for libsdl to enable logging. (similar to _VNC_DEBUG) Signed-off-by: Marc-André Lureau --- include/ui/sdl2.h | 2 ++ ui/sdl2.c | 4 2 files changed, 6 insertions(+) diff --git a/include/ui/sdl2.h b/

[PATCH v2 12/18] ui/shader: fix #version directive must occur on first line

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau ANGLE fails to compile shaders otherwise. Signed-off-by: Marc-André Lureau --- ui/shader/texture-blit-flip.vert | 1 - ui/shader/texture-blit.frag | 1 - ui/shader/texture-blit.vert | 1 - 3 files changed, 3 deletions(-) diff --git a/ui/shader/texture-blit-fl

[PATCH v2 16/18] ui: introduce egl_init()

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau Future patches will introduce EGL support on win32 (too late for 8.0 though). Having a common place for EGL initialization and error handling will make it simpler. Signed-off-by: Marc-André Lureau --- include/ui/egl-helpers.h | 2 ++ ui/dbus.c| 7 +

[PATCH v2 05/18] meson: ensure dbus-display generated code is built before other units

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau It's simply by luck that dbus-display header is built first before the other units using it. With sourceset, I can't find an easier way out than declaring an extra dependency for dbus-display1 generate code. Signed-off-by: Marc-André Lureau --- ui/meson.build | 6 -

[PATCH v2 02/18] ui/dbus: unregister clipboard on connection close

2023-03-07 Thread marcandre . lureau
From: Marc-André Lureau Fixes unregistration with p2p connections, since they don't have an associated name owner. Signed-off-by: Marc-André Lureau --- ui/dbus-clipboard.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/ui/dbus-clipboard.c b/ui/dbus-clip

<    5   6   7   8   9   10   11   12   13   14   >