aboutsummaryrefslogtreecommitdiff
path: root/qemu-keymap.c
AgeCommit message (Collapse)Author
2024-10-03qemu-keymap: Release local allocation referencesAkihiko Odaki
Commit 2523baf7fb4d ("qemu-keymap: Make references to allocations static") made references to allocations static to ensure LeakSanitizer can track them. This trick unfortunately did not work with gcc version 14.0.1; that compiler is clever enough to know that the value of the "state" variable is only referred in the current execution of the function and to put it on the stack. Release references to allocations and suppress the error once for all. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-05-29qemu-keymap: Make references to allocations staticAkihiko Odaki
LeakSanitizer complains about allocations whose references are held only by automatic variables. It is possible to free them to suppress the complaints, but it is a chore to make sure they are freed in all exit paths so make them static instead. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20240524-xkb-v4-1-2de564e5c859@daynix.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2023-07-03qemu-keymap: properly check return from xkb_keymap_mod_get_indexAlex Bennée
We can return XKB_MOD_INVALID for AltGr which rightly gets flagged by sanitisers as an overly wide shift attempt. Properly check the return type and leave the bitmap as zero in that case. Tested output before and after is unchanged with the gb and ara keymaps. Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20230630180423.558337-7-alex.bennee@linaro.org>
2023-02-27qemu-keymap: Silence memory leak warning from Clang's sanitizerThomas Huth
When compiling QEMU with "--enable-sanitizers --enable-xkbcommon --cc=clang" there is a memory leak warning when running qemu-keymap: $ ./qemu-keymap -f pc-bios/keymaps/de -l de ================================================================= ==610321==ERROR: LeakSanitizer: detected memory leaks Direct leak of 136 byte(s) in 1 object(s) allocated from: #0 0x5642830d0820 in __interceptor_calloc.part.11 asan_malloc_linux.cpp.o #1 0x7f31873b8d2b in xkb_state_new (/lib64/libxkbcommon.so.0+0x1dd2b) (BuildId: dd32581e2248833243f3f646324ae9b98469f025) SUMMARY: AddressSanitizer: 136 byte(s) leaked in 1 allocation(s). It can be silenced by properly releasing the "state" again after it has been used. Message-Id: <20230221122440.612281-1-thuth@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
2021-12-17qemu-keymap: Add license in generated filesPhilippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Warner Losh <imp@bsdimp.com> Message-Id: <20211117174533.1900570-1-philmd@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2019-06-12Include qemu-common.h exactly where neededMarkus Armbruster
No header includes qemu-common.h after this commit, as prescribed by qemu-common.h's file comment. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20190523143508.25387-5-armbru@redhat.com> [Rebased with conflicts resolved automatically, except for include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and net/tap-bsd.c fixed up]
2018-08-24ui: use enum to string helpersMarc-André Lureau
Minor code simplification. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 20180801092508.4927-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2018-02-09Drop superfluous includes of qapi-types.h and test-qapi-types.hMarkus Armbruster
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20180201111846.21846-4-armbru@redhat.com>
2017-10-16tools: add qemu-keymapGerd Hoffmann
qemu-keymap generates qemu reverse keymaps from xkb keymaps, which can be used with the qemu "-k" command line switch. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20171005153330.19210-2-kraxel@redhat.com