#
75b773d8 |
| 25-Sep-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32: avoid discarding the exception handler
In all likelihood, the compiler with lto doesn't see the function being used, from assembly macro __try1. Help it by marking the function has being used
win32: avoid discarding the exception handler
In all likelihood, the compiler with lto doesn't see the function being used, from assembly macro __try1. Help it by marking the function has being used.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1904
Fixes: commit d89f30b4df ("win32: wrap socket close() with an exception handler")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
c5b5288c |
| 28-Jul-2023 |
Thomas Huth <thuth@redhat.com> |
util/oslib-win32: Fix compiling with Clang from MSYS2
Clang complains:
../util/oslib-win32.c:483:56: error: omitting the parameter name in a function definition is a C2x extension [-Werror,-Wc2x-e
util/oslib-win32: Fix compiling with Clang from MSYS2
Clang complains:
../util/oslib-win32.c:483:56: error: omitting the parameter name in a function definition is a C2x extension [-Werror,-Wc2x-extensions] win32_close_exception_handler(struct _EXCEPTION_RECORD*, ^ Fix it by adding parameter names.
Message-Id: <20230728142748.305341-4-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
09b4c198 |
| 06-Jun-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
console/win32: allocate shareable display surface
Introduce qemu_win32_map_alloc() and qemu_win32_map_free() to allocate shared memory mapping. The handle can be used to share the mapping with anoth
console/win32: allocate shareable display surface
Introduce qemu_win32_map_alloc() and qemu_win32_map_free() to allocate shared memory mapping. The handle can be used to share the mapping with another process.
Teach qemu_create_displaysurface() to allocate shared memory. Following patches will introduce other places for shared memory allocation.
Other patches for -display dbus will share the memory when possible with the client, to avoid expensive memory copy between the processes.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-10-marcandre.lureau@redhat.com>
show more ...
|
#
d89f30b4 |
| 15-May-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32: wrap socket close() with an exception handler
Since commit abe34282 ("win32: avoid mixing SOCKET and file descriptor space"), we set HANDLE_FLAG_PROTECT_FROM_CLOSE on the socket FD, to preven
win32: wrap socket close() with an exception handler
Since commit abe34282 ("win32: avoid mixing SOCKET and file descriptor space"), we set HANDLE_FLAG_PROTECT_FROM_CLOSE on the socket FD, to prevent closing the HANDLE with CloseHandle. This raises an exception which under gdb is fatal, and qemu exits.
Let's catch the expected error instead.
Note: this appears to work, but the mingw64 macro is not well documented or tested, and it's not obvious how it is meant to be used.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230515132440.1025315-1-marcandre.lureau@redhat.com>
show more ...
|
Revision tags: v8.0.0 |
|
#
f3ab43ac |
| 20-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32: add qemu_close_socket_osfhandle()
Close the given file descriptor, but returns the underlying SOCKET.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Be
win32: add qemu_close_socket_osfhandle()
Close the given file descriptor, but returns the underlying SOCKET.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230320133643.1618437-2-marcandre.lureau@redhat.com>
show more ...
|
#
0a237f4d |
| 06-Mar-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
osdep: implement qemu_socketpair() for win32
Manually implement a socketpair() function, using UNIX sockets and simple peer credential checking.
QEMU doesn't make much use of socketpair, beside vho
osdep: implement qemu_socketpair() for win32
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.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230306122751.2355515-5-marcandre.lureau@redhat.com>
show more ...
|
#
25657fc6 |
| 21-Feb-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32: replace closesocket() with close() wrapper
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
win32: replace closesocket() with close() wrapper
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 <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-17-marcandre.lureau@redhat.com>
show more ...
|
#
abe34282 |
| 21-Feb-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32: avoid mixing SOCKET and file descriptor space
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 eventual
win32: avoid mixing SOCKET and file descriptor space
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 SOCKET space. Such conflict would have surprising consequences, we shouldn't mix them.
Also, it is often forgotten that SOCKET must be closed with closesocket(), and not close().
Instead, let's make the win32 socket wrapper functions return and take a file descriptor, and let util/ wrappers do the fd/SOCKET conversion as necessary. A bit of adaptation is necessary in io/ as well.
Unfortunately, we can't drop closesocket() usage, despite _open_osfhandle() documentation claiming transfer of ownership, testing shows bad behaviour if you forget to call closesocket().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-15-marcandre.lureau@redhat.com>
show more ...
|
#
a4aafea2 |
| 21-Feb-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32/socket: introduce qemu_socket_unselect() helper
A more explicit version of qemu_socket_select() with no events.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Ste
win32/socket: introduce qemu_socket_unselect() helper
A more explicit version of qemu_socket_select() with no events.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-8-marcandre.lureau@redhat.com>
show more ...
|
#
f5fd677a |
| 21-Feb-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
win32/socket: introduce qemu_socket_select() helper
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 ye
win32/socket: introduce qemu_socket_select() helper
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 <marcandre.lureau@redhat.com> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Message-Id: <20230221124802.4103554-7-marcandre.lureau@redhat.com>
show more ...
|
#
8278e30c |
| 21-Feb-2023 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
util: drop qemu_fork()
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 pos
util: drop qemu_fork()
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 <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20230221124802.4103554-2-marcandre.lureau@redhat.com>
show more ...
|
Revision tags: v7.2.0 |
|
#
d66d09cb |
| 08-Dec-2022 |
Thomas Huth <thuth@redhat.com> |
util/oslib-win32: Remove obsolete reference to g_poll code
The comment about g_poll is not required here anymore since the corresponding code has been removed a while ago already.
Fixes: b4c6036faa
util/oslib-win32: Remove obsolete reference to g_poll code
The comment about g_poll is not required here anymore since the corresponding code has been removed a while ago already.
Fixes: b4c6036faa ("configure: bump min required glib version to 2.56") Message-Id: <20221208133257.95673-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
show more ...
|
#
e04a34e5 |
| 14-Oct-2022 |
David Hildenbrand <david@redhat.com> |
util: Make qemu_prealloc_mem() optionally consume a ThreadContext
... and implement it under POSIX. When a ThreadContext is provided, create new threads via the context such that these new threads o
util: Make qemu_prealloc_mem() optionally consume a ThreadContext
... and implement it under POSIX. When a ThreadContext is provided, create new threads via the context such that these new threads obtain a properly configured CPU affinity.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20221014134720.168738-6-david@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
show more ...
|
#
6556aadc |
| 14-Oct-2022 |
David Hildenbrand <david@redhat.com> |
util: Cleanup and rename os_mem_prealloc()
Let's * give the function a "qemu_*" style name * make sure the parameters in the implementation match the prototype * rename smp_cpus to max_threads, whic
util: Cleanup and rename os_mem_prealloc()
Let's * give the function a "qemu_*" style name * make sure the parameters in the implementation match the prototype * rename smp_cpus to max_threads, which makes the semantics of that parameter clearer
... and add a function documentation.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Message-Id: <20221014134720.168738-2-david@redhat.com> Signed-off-by: David Hildenbrand <david@redhat.com>
show more ...
|
#
49e0128c |
| 25-May-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
util/win32: simplify qemu_get_local_state_dir()
SHGetFolderPath() is a deprecated API: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha
It is a wrapper
util/win32: simplify qemu_get_local_state_dir()
SHGetFolderPath() is a deprecated API: https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shgetfolderpatha
It is a wrapper for SHGetKnownFolderPath() and CSIDL_COMMON_PATH is mapped to FOLDERID_ProgramData: https://docs.microsoft.com/en-us/windows/win32/shell/csidl
g_get_system_data_dirs() is a suitable replacement, as it will have FOLDERID_ProgramData in the returned list. However, it follows the XDG Base Directory Specification, if `XDG_DATA_DIRS` is defined, it will be returned instead.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Weil <sw@weilnetz.de> Message-Id: <20220525144140.591926-3-marcandre.lureau@redhat.com>
show more ...
|
#
06680b15 |
| 25-May-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
include: move qemu_*_exec_dir() to cutils
The function is required by get_relocated_path() (already in cutils), and used by qemu-ga and may be generally useful.
Signed-off-by: Marc-André Lureau <ma
include: move qemu_*_exec_dir() to cutils
The function is required by get_relocated_path() (already in cutils), and used by qemu-ga and may be generally useful.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20220525144140.591926-2-marcandre.lureau@redhat.com>
show more ...
|
#
ff5927ba |
| 25-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
util: rename qemu_*block() socket functions
The qemu_*block() functions are meant to be be used with sockets (the win32 implementation expects SOCKET)
Over time, those functions where used with Win
util: rename qemu_*block() socket functions
The qemu_*block() functions are meant to be be used with sockets (the win32 implementation expects SOCKET)
Over time, those functions where used with Win32 SOCKET or file-descriptors interchangeably. But for portability, they must only be used with socket-like file-descriptors. FDs can use g_unix_set_fd_nonblocking() instead.
Rename the functions with "socket" in the name to prevent bad usages.
This is effectively reverting commit f9e8cacc5557e43 ("oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()").
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
show more ...
|
#
1fbf2665 |
| 20-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
util: replace qemu_get_local_state_pathname()
Simplify the function to only return the directory path. Callers are adjusted to use the GLib function to build paths, g_build_filename().
Signed-off-b
util: replace qemu_get_local_state_pathname()
Simplify the function to only return the directory path. Callers are adjusted to use the GLib function to build paths, g_build_filename().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-39-marcandre.lureau@redhat.com>
show more ...
|
#
548fb0da |
| 20-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
qga: move qga_get_host_name()
The function is specific to qemu-ga, no need to share it in QEMU.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berra
qga: move qga_get_host_name()
The function is specific to qemu-ga, no need to share it in QEMU.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Message-Id: <20220420132624.2439741-32-marcandre.lureau@redhat.com>
show more ...
|
#
73991a92 |
| 20-Apr-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
include: move qemu_msync() to osdep
The implementation depends on the OS. (and longer-term goal is to move cutils to a common subproject)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.c
include: move qemu_msync() to osdep
The implementation depends on the OS. (and longer-term goal is to move cutils to a common subproject)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20220420132624.2439741-21-marcandre.lureau@redhat.com>
show more ...
|
Revision tags: v7.0.0 |
|
#
0f9668e0 |
| 23-Mar-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
Remove qemu-common.h include from most units
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com> Signed-off-by: Paolo B
Remove qemu-common.h include from most units
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-33-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
8e3b0cbb |
| 23-Mar-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
Replace qemu_real_host_page variables with inlined functions
Replace the global variables with inlined helper functions. getpagesize() is very likely annotated with a "const" function attribute (at
Replace qemu_real_host_page variables with inlined functions
Replace the global variables with inlined helper functions. getpagesize() is very likely annotated with a "const" function attribute (at least with glibc), and thus optimization should apply even better.
This avoids the need for a constructor initialization too.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220323155743.1585078-12-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
e536f16e |
| 07-Mar-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
oslib: drop qemu_gettimeofday()
No longer used after the previous patches.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by
oslib: drop qemu_gettimeofday()
No longer used after the previous patches.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220307070401.171986-6-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
#
1a11265d |
| 26-Feb-2022 |
Peter Maydell <peter.maydell@linaro.org> |
util: Put qemu_vfree() in memalign.c
qemu_vfree() is the companion free function to qemu_memalign(); put it in memalign.c so the allocation and free functions are together.
Signed-off-by: Peter May
util: Put qemu_vfree() in memalign.c
qemu_vfree() is the companion free function to qemu_memalign(); put it in memalign.c so the allocation and free functions are together.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220226180723.1706285-9-peter.maydell@linaro.org Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
show more ...
|
#
5c8c714a |
| 26-Feb-2022 |
Peter Maydell <peter.maydell@linaro.org> |
util: Share qemu_try_memalign() implementation between POSIX and Windows
The qemu_try_memalign() functions for POSIX and Windows used to be significantly different, but these days they are identical
util: Share qemu_try_memalign() implementation between POSIX and Windows
The qemu_try_memalign() functions for POSIX and Windows used to be significantly different, but these days they are identical except for the actual allocation function called, and the POSIX version already has to have ifdeffery for different allocation functions.
Move to a single implementation in memalign.c, which uses the Windows _aligned_malloc if we detect that function in meson.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220226180723.1706285-7-peter.maydell@linaro.org Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
show more ...
|