summary refs log tree commit diff stats
path: root/hw/net/virtio-net.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2025-10-01rust: qdev: add minimal clock bindingsPaolo Bonzini1-0/+33
Add the minimal support that is needed by pl011's event and tracepoint. Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-11-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01rust: add trace crateTanish Desai7-2/+83
The trace crate is a minimal container for dependencies of tracepoints (so that they do not have to be imported in all the crates that use tracepoints); it also contains a macro called "include_trace!" that is able to find the right include file from the trace/ directory. [Write commit message, add #[allow()]. - Paolo] Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-10-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01tracetool: Add Rust format supportTanish Desai2-0/+219
Generating .rs files makes it possible to support tracing in rust. This support comprises a new format, and common code that converts the C expressions in trace-events to Rust. In particular, types need to be converted, and PRI macros expanded. As of this commit no backend generates Rust code, but it is already possible to use tracetool to generate Rust sources; they are not functional but they compile and contain tracepoint functions. [Move Rust argument conversion from Event to Arguments; string support. - Paolo] Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-9-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01tracetool/backend: remove redundant trace event checksTanish Desai5-28/+20
Use CHECK_TRACE_EVENT_GET_STATE in log, syslog, dtrace and simple backend, so that the "if (trace_event_get_state)" is created from common code and unified when multiple backends are active. When a single backend is active there is no code change (except for the log backend, as shown in tests/tracetool/log.h), but the code in the backends is simpler. Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250929154938.594389-8-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01tracetool: add CHECK_TRACE_EVENT_GET_STATETanish Desai2-16/+36
Add a new attribute CHECK_TRACE_EVENT_GET_STATE to the backends. When present and True, the code generated by the generate function is wrapped in a conditional that checks whether the event is enabled; this removes the need for repeating the same conditional in multiple backends. Signed-off-by: Tanish Desai <tanishdesai37@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250929154938.594389-7-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01trace/ftrace: move snprintf+write from tracepoints to ftrace.cPaolo Bonzini4-32/+24
This simplifies the Python code and reduces the size of the tracepoints. Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Zhao Liu <zhao1.liu@intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250929154938.594389-6-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01tracetool: add SPDX headersPaolo Bonzini17-0/+34
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-5-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01treewide: remove unnessary "coding" headerPaolo Bonzini36-61/+1
The "-*- coding: utf-8 -*-" header was needed in Python 2, but in Python 3 UTF-8 is already the default encoding of source files. It is even less necessary in .css files that do not have UTF-8 sequences at all. Suggested-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-4-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01tracetool: remove dead codePaolo Bonzini4-48/+6
Remove a bunch of dead code from tracetool. In particular, there are no tcg-exec events anymore and the sub-event functionality was only used for it. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-3-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01tracetool: fix usage of try_import()Paolo Bonzini2-2/+2
try_import returns a tuple of a boolean and the requested module or attribute. exists() functions return tracetool.try_import("tracetool.format." + name)[1] but they should return the boolean value instead. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250929154938.594389-2-pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-10-01error: Kill @error_warnMarkus Armbruster11-39/+49
We added @error_warn some two years ago in commit 3ffef1a55ca (error: add global &error_warn destination). It has multiple issues: * error.h's big comment was not updated for it. * Function contracts were not updated for it. * ERRP_GUARD() is unaware of @error_warn, and fails to mask it from error_prepend() and such. These crash on @error_warn, as pointed out by Akihiko Odaki. All fixable. However, after more than two years, we had just of 15 uses, of which the last few patches removed seven as unclean or otherwise undesirable, adding back five elsewhere. I didn't look closely enough at the remaining seven to decide whether they are desirable or not. I don't think this feature earns its keep. Drop it. Thanks-to: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Message-ID: <20250923091000.3180122-14-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-10-01ivshmem-flat: Mark an instance of missing error handling FIXMEMarkus Armbruster1-2/+6
ivshmem-flat's ivshmem_flat_add_vector() neglects to handle qemu_set_blocking() failure. It used to silently ignore errors there. Recent commit 6f607941b1c (treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking) changed it to warn (without mentioning it the commit message, tsk, tsk, tsk). Note that ivshmem-pci's process_msg_connect() handles this error. Add a FIXME comment to mark the missing error handling. Cc: Gustavo Romero <gustavo.romero@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20250923091000.3180122-13-armbru@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-10-01ui/dbus: Consistent handling of texture mutex failureMarkus Armbruster1-6/+11
We report d3d_texture2d_acquire0() and d3d_texture2d_release0() failure as error, except in dbus_update_gl_cb(), where we report it as warning. Report it as error there as well. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20250923091000.3180122-12-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30build-sys: pass -fvisibility=default for wasm bindgenMarc-André Lureau9-1/+13
Otherwise, no functions are generated: https://github.com/rust-lang/rust-bindgen/issues/2989 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Kohei Tokunaga <ktokunaga.mail@gmail.com> Message-ID: <20250924120426.2158655-27-marcandre.lureau@redhat.com>
2025-09-30build-sys: deprecate mips hostMarc-André Lureau3-8/+11
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250924120426.2158655-26-marcandre.lureau@redhat.com>
2025-09-30meson: rust-bindgen limit allowlist-file to srcdir/includeMarc-André Lureau1-2/+1
gitlab CI restricts usage of directories for the build environment and cache. Msys64 is installed under project root ($srcdir/msys64). This confuses rust-bindgen allowlist-file which will generate bindings for all the system include headers under msys64/. blocklist-file is also too strict, as it prevents generating all the recursively dependent types coming from system includes. Instead, let's not use allowlist-file from the project root, Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20250924120426.2158655-22-marcandre.lureau@redhat.com>
2025-09-30tests/freebsd: enable RustMarc-André Lureau2-2/+4
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-21-marcandre.lureau@redhat.com>
2025-09-30configure: set the meson executable suffix/extMarc-André Lureau1-1/+13
The 'rustfmt' target runs meson: it needs the correct path with extension on Windows. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-20-marcandre.lureau@redhat.com>
2025-09-30tests/lcitool: enable rust & refreshMarc-André Lureau16-3/+41
Enable Rust on various distro images: alpine, centos, debian, fedora, opensuse. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250924120426.2158655-19-marcandre.lureau@redhat.com>
2025-09-30tests/docker: add ENABLE_RUST environmentMarc-André Lureau1-0/+9
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-18-marcandre.lureau@redhat.com>
2025-09-30tests/lcitool: update to debian13Marc-André Lureau9-46/+149
riscv64 is now a supported architecture. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250924120426.2158655-17-marcandre.lureau@redhat.com>
2025-09-30tests/lcitool: add missing rust-std depMarc-André Lureau17-1/+18
Some distros/targets may pull it by default, but some don't. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-16-marcandre.lureau@redhat.com>
2025-09-30lcitool/alpine: workaround bindgen issueMarc-André Lureau2-1/+9
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-15-marcandre.lureau@redhat.com>
2025-09-30lcitool/qemu: include libclang-rt for TSANMarc-André Lureau18-0/+18
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-14-marcandre.lureau@redhat.com>
2025-09-30lcitool: update, switch to f41Marc-André Lureau20-37/+79
Newer lcitool version has various fixes helping QEMU CI and this series. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-13-marcandre.lureau@redhat.com>
2025-09-30build-sys: cfi_debug and safe_stack are not compatibleMarc-André Lureau2-3/+6
It fails to link on fedora >= 41: /usr/bin/ld: /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.safestack.a(safestack.cpp.o): in function `__sanitizer_internal_memcpy': (.text.__sanitizer_internal_memcpy+0x0): multiple definition of `__sanitizer_internal_memcpy'; /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.ubsan_standalone.a(sanitizer_libc.cpp.o):(.text.__sanitizer_internal_memcpy+0x0): first defined here /usr/bin/ld: /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.safestack.a(safestack.cpp.o): in function `__sanitizer_internal_memmove': (.text.__sanitizer_internal_memmove+0x0): multiple definition of `__sanitizer_internal_memmove'; /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.ubsan_standalone.a(sanitizer_libc.cpp.o):(.text.__sanitizer_internal_memmove+0x0): first defined here /usr/bin/ld: /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.safestack.a(safestack.cpp.o): in function `__sanitizer_internal_memset': (.text.__sanitizer_internal_memset+0x0): multiple definition of `__sanitizer_internal_memset'; /usr/bin/../lib/clang/20/lib/x86_64-redhat-linux-gnu/libclang_rt.ubsan_standalone.a(sanitizer_libc.cpp.o):(.text.__sanitizer_internal_memset+0x0): first defined here cfi_debug seems to pull ubsan which has conflicting symbols with safe_stack. See also: https://bugzilla.redhat.com/show_bug.cgi?id=2397265 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-12-marcandre.lureau@redhat.com>
2025-09-30tests/docker/common: print meson log on configure failureMarc-André Lureau1-1/+1
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-11-marcandre.lureau@redhat.com>
2025-09-30tests/docker: use fully qualified image name for emsdkMarc-André Lureau1-1/+1
Without it, at least it fails with podman on fc42: [1/6] STEP 1/15: FROM emscripten/emsdk:3.1.50 AS build-base Error: creating build container: short-name resolution enforced but cannot prompt without a TTY Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Kohei Tokunaga <ktokunaga.mail@gmail.com> Message-ID: <20250924120426.2158655-10-marcandre.lureau@redhat.com>
2025-09-30tests/docker/common: print errors to stderrMarc-André Lureau1-2/+2
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-9-marcandre.lureau@redhat.com>
2025-09-30configure: set the bindgen cross targetMarc-André Lureau4-0/+110
Implement a bash version of rust-bindgen rust_to_clang_target() to convert from rust target to clang target. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-ID: <20250924120426.2158655-8-marcandre.lureau@redhat.com>
2025-09-30configure: fix rust meson configurationMarc-André Lureau1-1/+1
It was incorrectly set on the [host_machine] and caused error: File "/tmp/qemu-test/build/pyvenv/lib/python3.11/site-packages/mesonbuild/envconfig.py", line 281, in from_literal assert all(isinstance(v, str) for v in raw.values()), 'for mypy' AssertionError: for mypy Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-7-marcandre.lureau@redhat.com>
2025-09-30scripts/archive-source: use a bash arrayMarc-André Lureau1-8/+23
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250924120426.2158655-6-marcandre.lureau@redhat.com>
2025-09-30scripts/archive-source: silence subprojects downloadsMarc-André Lureau1-1/+1
It's too verbose. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250924120426.2158655-5-marcandre.lureau@redhat.com>
2025-09-30scripts/archive-source: speed up downloading subprojectsMarc-André Lureau1-2/+3
Running meson on each subproject is quite slow. According to Paolo, meson will run download tasks in parallel. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250924120426.2158655-4-marcandre.lureau@redhat.com>
2025-09-30gitlab-ci: fix 'needs' property type must be arrayMarc-André Lureau3-54/+54
The gitlab "Pipeline editor" has some warnings, and gitlab-ci-local fails. Read also from the docs https://docs.gitlab.com/ci/yaml/#needs "Supported values: An array of jobs (maximum of 50 jobs). An empty array ([]), to set the job to start as soon as the pipeline is created." Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250924120426.2158655-3-marcandre.lureau@redhat.com>
2025-09-30build-sys: require -lrt when no shm_open() in std libsMarc-André Lureau1-7/+9
Fail during configure time if the shm functions are missing, as required by oslib-posix.c. Note, we could further check the presence of the function in librt. This is a minor cleanup/improvement. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-ID: <20250924120426.2158655-2-marcandre.lureau@redhat.com>
2025-09-30ui/dbus: Clean up dbus_update_gl_cb() error checkingMarkus Armbruster1-3/+6
From GLib "Rules for use of GError": A GError* must be initialized to NULL before passing its address to a function that can report errors. dbus_update_gl_cb() seemingly violates this rule: it passes &err to qemu_dbus_display1_listener_call_update_dmabuf_finish() and to qemu_dbus_display1_listener_win32_d3d11_call_update_texture2d_finish() without clearing it in between. Harmless, because the first call is guarded by #ifdef CONFIG_GBM, the second by #ifdef WIN32, and the two are mutually exclusive. I think. Clean this up to be obviously correct. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20250923091000.3180122-11-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30ui/pixman: Consistent error handling in qemu_pixman_shareable_free()Markus Armbruster1-1/+4
qemu_pixman_shareable_free() wraps around either qemu_memfd_free() or qemu_win32_map_free(). The former reports trouble as error, with error_report(), then succeeds. The latter reports it as warning (we pass it &error_warn), then succeeds. Change the latter to report as error, too. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20250923091000.3180122-10-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30util/oslib-win32: Do not treat null @errp as &error_warnMarkus Armbruster4-9/+5
qemu_socket_select() and its wrapper qemu_socket_unselect() treat a null @errp as &error_warn. This is wildly inappropriate. A caller passing null @errp specifies that errors are to be ignored. If warnings are wanted, the caller must pass &error_warn. Change callers to do that, and drop the inappropriate treatment of null @errp. This assumes that warnings are wanted. I'm not familiar with the calling code, so I can't say whether it will work when the socket is invalid, or WSAEventSelect() fails. If it doesn't, then this should be an error instead of a warning. Invalid socket might even be a programming error. These warnings were introduced in commit f5fd677ae7cf (win32/socket: introduce qemu_socket_select() helper). I considered reverting to silence, but Daniel Berrangé asked for the warnings to be preserved. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250923091000.3180122-9-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30ui/spice-core: Clean up error reportingMarkus Armbruster1-2/+4
watch_add() reports _open_osfhandle() failure with error_setg(&error_warn, ...). error_setg_win32(&error_warn, ...) is undesirable just like error_setg(&error_fatal, ...) and error_setg(&error_abort, ...) are. Replace by warn_report(). The failure should probably be an error, but this function implements a callback that doesn't take Error **. I believe the failure will make spice_server_init() fail in qemu_spice_init(), which is treated as a fatal error. The warning here provides more detail than the error message there. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250923091000.3180122-8-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30net/slirp: Clean up error reportingMarkus Armbruster1-2/+7
net_slirp_register_poll_sock() and net_slirp_unregister_poll_sock() report WSAEventSelect() failure with error_setg(&error_warn, ...). error_setg_win32(&error_warn, ...) is undesirable just like error_setg(&error_fatal, ...) and error_setg(&error_abort, ...) are. Replace by warn_report(). The failures should probably be errors, but these functions implement callbacks that cannot fail, exit(1) would be too harsh, and silent failure we don't want. Thus, warnings. Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20250923091000.3180122-7-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30hw/remote/vfio-user: Clean up error reportingMarkus Armbruster1-4/+9
VFU_OBJECT_ERROR() reports the error with error_setg(&error_abort, ...) when auto-shutdown is enabled, else with error_report(). Issues: 1. The error is serious enough to warrant aborting the process when auto-shutdown is enabled, yet harmless enough to permit carrying on when it's disabled. This makes no sense to me. 2. Like assert(), &error_abort is strictly for programming errors. Is this one? Vladimir Sementsov-Ogievskiy tells me it's not. Should we exit(1) instead? 3. qapi/error.h advises "don't error_setg(&error_abort, ...), use assert()." This patch addresses just 3. It adds a FIXME comment for the other two. Cc: Jagannathan Raman <jag.raman@oracle.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-ID: <20250923091000.3180122-6-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru> [FIXME comment added, commit message adjusted accordingly] Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30migration/cpr: Clean up error reporting in cpr_resave_fd()Markus Armbruster1-4/+5
qapi/error.h advises: * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. Do that, and replace exit() by g_assert_not_reached(), since this is actually a programming error. Cc: Steve Sistare <steven.sistare@oracle.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Steve Sistare <steven.sistare@oracle.com> Message-ID: <20250923091000.3180122-5-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30hw/cxl: Convert cxl_fmws_link() to ErrorMarkus Armbruster1-3/+4
Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is bogus. cxl_fmws_link_targets() violates this principle: it calls error_setg(&error_fatal, ...) via cxl_fmws_link(). Goes back to commit 584f722eb3ab (hw/cxl: Make the CXL fixed memory windows devices.) Currently harmless, because cxl_fmws_link_targets()'s callers always pass &error_fatal. Clean this up by converting cxl_fmws_link() to Error. Also change its return value on error from 1 to -1 to conform to the rules laid in qapi/error.h. It's call chain cxl_fmws_link_targets() via object_child_foreach_recursive() is fine with that. Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20250923091000.3180122-4-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30tcg: Fix error reporting on mprotect() failure in tcg_region_init()Markus Armbruster1-2/+5
tcg_region_init() calls one of qemu_mprotect_rwx(), qemu_mprotect_rw(), and mprotect(), then reports failure with error_setg_errno(&error_fatal, errno, ...). The use of &error_fatal is undesirable. qapi/error.h advises: * Please don't error_setg(&error_fatal, ...), use error_report() and * exit(), because that's more obvious. The use of errno is wrong. qemu_mprotect_rwx() and qemu_mprotect_rw() wrap around qemu_mprotect__osdep(). qemu_mprotect__osdep() calls mprotect() on POSIX, VirtualProtect() on Windows, and reports failure with error_report(). VirtualProtect() doesn't set errno. mprotect() does, but error_report() may clobber it. Fix tcg_region_init() to report errors only when it calls mprotect(), and rely on qemu_mprotect_rwx()'s and qemu_mprotect_rw()'s error reporting otherwise. Use error_report(), not error_setg(). Fixes: 22c6a9938f75 (tcg: Merge buffer protection and guard page protection) Fixes: 6bc144237a85 (tcg: Use Error with alloc_code_gen_buffer) Cc: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250923091000.3180122-3-armbru@redhat.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30monitor: Clean up HMP gdbserver error reportingMarkus Armbruster2-6/+4
HMP command gdbserver used to emit two error messages for certain errors. For instance, with -M none: (qemu) gdbserver gdbstub: meaningless to attach gdb to a machine without any CPU. Could not open gdbserver on device 'tcp::1234' The first message is the specific error, and the second one a generic additional message that feels superfluous to me. Commit c0e6b8b798b (system: propagate Error to gdbserver_start (and other device setups)) turned the first message into a warning: warning: gdbstub: meaningless to attach gdb to a machine without any CPU. Could not open gdbserver on device 'tcp::1234' This is arguably worse. hmp_gdbserver() passes &error_warn to gdbserver_start(), so that failure gets reported as warning, and then additionally emits the generic error on failure. This is a misuse of &error_warn. Instead, receive the error in &err and report it, as usual. With this, gdbserver reports just the error: gdbstub: meaningless to attach gdb to a machine without any CPU. Cc: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20250923091000.3180122-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
2025-09-30ui/icons/qemu.svg: Add metadata information (author, license) to the logoThomas Huth1-1/+20
We've got two versions of the QEMU logo in the repository, one with the whole word "QEMU" (pc-bios/qemu_logo.svg) and one that only contains the letter "Q" (ui/icons/qemu.svg). While qemu_logo.svg contains the proper metadata with license and author information, this is missing from the ui/icons/qemu.svg file. Copy the meta data there so that people have a chance to know the license of the file if they only look at the qemu.svg file. Closes: https://gitlab.com/qemu-project/qemu/-/issues/3139 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20250930071419.117592-1-thuth@redhat.com>
2025-09-30ui/sdl2: fix reset scaling binding to be consistent with gtkNir Lichtman1-1/+1
Problem: Currently the reset scaling hotkey is inconsistent between SDL and GTK graphics modes. Solution: Fix SDL to use MOD+0 instead of MOD+u which is in line with GTK and generally more consistent with other apps. This is also related to my previously sent patch fixing the docs. Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Nir Lichtman <nir@lichtman.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20250910114929.GA1783677@lichtman.org>
2025-09-30ui/spice: fix crash when disabling GL scanout onMarc-André Lureau1-1/+3
When spice_qxl_gl_scanout2() isn't available, the fallback code incorrectly handles NULL arguments to disable the scanout, leading to: Program terminated with signal SIGSEGV, Segmentation fault. #0 spice_server_gl_scanout (qxl=0x55a25ce57ae8, fd=0x0, width=0, height=0, offset=0x0, stride=0x0, num_planes=0, format=0, modifier=72057594037927935, y_0_top=0) at ../ui/spice-display.c:983 983 if (num_planes <= 1) { Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2391334 Fixes: 98a050ca93afd8 ("ui/spice: support multi plane dmabuf scanout") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Message-Id: <20250903193818.2460914-1-marcandre.lureau@redhat.com>
2025-09-30ui/spice: Fix abort on macOSMohamed Akram1-5/+1
The check is faulty because the thread variable was assigned in the main thread while the main loop runs in a different thread on macOS. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3070 Signed-off-by: Mohamed Akram <mohd.akram@outlook.com> Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <C87205B9-DD8F-4E53-AB5B-C8BF82EF1D16@outlook.com>