- Jan 13, 2021
-
-
Lukas Straub authored
The yank feature allows to recover from hanging qemu by "yanking" at various parts. Other qemu systems can register themselves and multiple yank functions. Then all yank functions for selected instances can be called by the 'yank' out-of-band qmp command. Available instances can be queried by a 'query-yank' oob command. Signed-off-by:
Lukas Straub <lukasstraub2@web.de> Acked-by:
Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <69934ceacfd33a7dfe53db145ecc630ad39ee47c.1609167865.git.lukasstraub2@web.de> Acked-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Jan 11, 2021
-
-
Philippe Mathieu-Daudé authored
Commit dfbd0b87 inadvertently swapped the arguments of _aligned_malloc(), correct it to fix [*]: G_TEST_SRCDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/tests G_TEST_BUILDDIR=C:/Users/ContainerAdministrator/AppData/Local/Temp/cirrus-ci-build/build/tests tests/test-qht.exe --tap -k ERROR test-qht - too few tests run (expected 2, got 0) make: *** [Makefile.mtest:256: run-test-30] Error 1 [*] https://cirrus-ci.com/task/6055645751279616?command=test#L593 Fixes: dfbd0b87 ("util/oslib-win32: Use _aligned_malloc for qemu_try_memalign") Reported-by:
Yonggang Luo <luoyonggang@gmail.com> Reported-by:
Volker Rümelin <vr_qemu@t-online.de> Suggested-by:
Volker Rümelin <vr_qemu@t-online.de> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Yonggang Luo <luoyonggang@gmail.com> Message-Id: <20210111001606.1122983-1-f4bug@amsat.org> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Jan 08, 2021
-
-
Peter Maydell authored
This commit is the result of running the timer-del-timer-free.cocci script on the whole source tree. Signed-off-by:
Peter Maydell <peter.maydell@linaro.org> Acked-by:
Corey Minyard <cminyard@mvista.com> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Richard Henderson <richard.henderson@linaro.org> Message-id: 20201215154107.3255-4-peter.maydell@linaro.org
-
- Jan 07, 2021
-
-
Richard Henderson authored
For darwin, the CTR_EL0 register is not accessible, but there are system routines that we can use. For other hosts, copy the single pointer implementation from libgcc and modify it to support the double pointer interface we require. This halves the number of cache operations required when split-rwx is enabled. Reviewed-by:
Joelle van Dyne <j@getutm.app> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
We are shortly going to have a split rw/rx jit buffer. Depending on the host, we need to flush the dcache at the rw data pointer and flush the icache at the rx code pointer. For now, the two passed pointers are identical, so there is no effective change in behaviour. Reviewed-by:
Joelle van Dyne <j@getutm.app> Reviewed-by:
Alex Bennée <alex.bennee@linaro.org> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Philippe Mathieu-Daudé authored
qemu_try_memalign() expects a power of 2 alignment: - posix_memalign(3): The address of the allocated memory will be a multiple of alignment, which must be a power of two and a multiple of sizeof(void *). - _aligned_malloc() The alignment value, which must be an integer power of 2. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20201021173803.2619054-3-philmd@redhat.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
Richard Henderson authored
We do not need or want to be allocating page sized quanta. Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Stefan Weil <sw@weilnetz.de> Message-Id: <20201018164836.1149452-1-richard.henderson@linaro.org> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by:
Richard Henderson <richard.henderson@linaro.org>
-
- Jan 06, 2021
-
-
Marc-André Lureau authored
Low-level fd users from QEMU use aio_set_fd_handler(), which handles event registration with the main loop; qemu_fd_register() is only needed together with the main loop's poll notifiers, of which SLIRP is the only user. This removes a dependency from oslib-win32.c to main-loop.c. Suggested-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201218135712.674094-1-marcandre.lureau@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Jan 04, 2021
-
-
Alex Chen authored
When the 'cmdline' is the last entry in 'rs->history' array, there is no need to put this entry to the end of the array, partly because it is the last entry, and partly because the next operition will lead to array index out of bounds. Reported-by:
Euler Robot <euler.robot@huawei.com> Signed-off-by:
Alex Chen <alex.chen@huawei.com> Message-id: 20201203135043.117072-1-alex.chen@huawei.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com>
-
- Jan 02, 2021
-
-
Richard Henderson authored
This has been a tcg-specific function, but is also in use by hardware accelerators via physmem.c. This can cause link errors when tcg is disabled. Signed-off-by:
Richard Henderson <richard.henderson@linaro.org> Reviewed-by:
Joelle van Dyne <j@getutm.app> Reviewed-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201214140314.18544-3-richard.henderson@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Daniele Buono authored
LLVM/Clang, supports runtime checks for forward-edge Control-Flow Integrity (CFI). CFI on indirect function calls (cfi-icall) ensures that, in indirect function calls, the function called is of the right signature for the pointer type defined at compile time. For this check to work, the code must always respect the function signature when using function pointer, the function must be defined at compile time, and be compiled with link-time optimization. This rules out, for example, shared libraries that are dynamically loaded (given that functions are not known at compile time), and code that is dynamically generated at run-time. This patch: 1) Introduces the CONFIG_CFI flag to support cfi in QEMU 2) Introduces a decorator to allow the definition of "sensitive" functions, where a non-instrumented function may be called at runtime through a pointer. The decorator will take care of disabling cfi-icall checks on such functions, when cfi is enabled. 3) Marks functions currently in QEMU that exhibit such behavior, in particular: - The function in TCG that calls pre-compiled TBs - The function in TCI that interprets instructions - Functions in the plugin infrastructures that jump to callbacks - Functions in util that directly call a signal handler Signed-off-by:
Daniele Buono <dbuono@linux.vnet.ibm.com> Acked-by:
Alex Bennée <alex.bennee@linaro.org> Message-Id: <20201204230615.2392-3-dbuono@linux.vnet.ibm.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 19, 2020
-
-
Markus Armbruster authored
QString supports modifying its string, but it's quite limited: you can only append. The remaining callers use it for building an initial string, never for modifying it later. Change keyval_parse_one() to do build the initial string with GString. This is another step towards making QString immutable. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20201211171152.146877-19-armbru@redhat.com>
-
Eric Blake authored
Anywhere we create a list of just one item or by prepending items (typically because order doesn't matter), we can use QAPI_LIST_PREPEND(). But places where we must keep the list in order by appending remain open-coded until later patches. Note that as a side effect, this also performs a cleanup of two minor issues in qga/commands-posix.c: the old code was performing new = g_malloc0(sizeof(*ret)); which 1) is confusing because you have to verify whether 'new' and 'ret' are variables with the same type, and 2) would conflict with C++ compilation (not an actual problem for this file, but makes copy-and-paste harder). Signed-off-by:
Eric Blake <eblake@redhat.com> Message-Id: <20201113011340.463563-5-eblake@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Acked-by:
Stefan Hajnoczi <stefanha@redhat.com> [Straightforward conflicts due to commit a8aa94b5 "qga: update schema for guest-get-disks 'dependents' field" and commit a10b453a "target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c" resolved. Commit message tweaked.] Signed-off-by:
Markus Armbruster <armbru@redhat.com>
-
- Dec 15, 2020
-
-
Paolo Bonzini authored
A QemuOptsList can be of one of two kinds: either it is pre-validated, or it accepts any key and validation happens somewhere else (typically in a Visitor or against a list of QOM properties). opts_accepts_any returns true if a QemuOpts instance was created from a QemuOptsList of the latter kind, but there is no function to do the check on a QemuOptsList. Since this property comes from the QemuOptsList and almost all callers of opts_accepts_any use opts->list anyway, modify the function to accept QemuOptsList. Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
Use strcspn to find an equal or comma value, and pass the result directly to get_opt_name to avoid another strchr. Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Dec 10, 2020
-
-
Paolo Bonzini authored
We want to make it independent of QemuOpts. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Paolo Bonzini authored
qemu_opts_set is used to create default network backends and to parse sugar options -kernel, -initrd, -append, -bios and -dtb. These are very different uses: I would *expect* a function named qemu_opts_set to set an option in a merge-lists QemuOptsList, such as -kernel, and possibly to set an option in a non-merge-lists QemuOptsList with non-NULL id, similar to -set. However, it wouldn't *work* to use qemu_opts_set for the latter because qemu_opts_set uses fail_if_exists==1. So, for non-merge-lists QemuOptsList and non-NULL id, the semantics of qemu_opts_set (fail if the (QemuOptsList, id) pair already exists) are debatable. On the other hand, I would not expect qemu_opts_set to create a non-merge-lists QemuOpts with a single option; which it does, though. For this case of non-merge-lists QemuOptsList and NULL id, qemu_opts_set hardly adds value over qemu_opts_parse. It does skip some parsing and unescaping, but that's not needed when creating default network backends. So qemu_opts_set has warty behavior for non-merge-lists QemuOptsList if id is non-NULL, and it's mostly pointless if id is NULL. My solution to keeping the API as simple as possible is to limit qemu_opts_set to merge-lists QemuOptsList. For them, it's useful (we don't want comma-unescaping for -kernel) *and* has sane semantics. Network backend creation is switched to qemu_opts_parse. qemu_opts_set is now only used on merge-lists QemuOptsList... except in the testcase, which is changed to use a merge-list QemuOptsList. With this change we can also remove the id parameter. With the parameter always NULL, we know that qemu_opts_create cannot fail and can pass &error_abort to it. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Markus Armbruster authored
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes, with the changes to the following files manually reverted: contrib/libvhost-user/libvhost-user-glib.h contrib/libvhost-user/libvhost-user.c contrib/libvhost-user/libvhost-user.h contrib/plugins/hotblocks.c contrib/plugins/hotpages.c contrib/plugins/howvec.c contrib/plugins/lockstep.c linux-user/mips64/cpu_loop.c linux-user/mips64/signal.c linux-user/sparc64/cpu_loop.c linux-user/sparc64/signal.c linux-user/x86_64/cpu_loop.c linux-user/x86_64/signal.c target/s390x/gen-features.c tests/fp/platform.h tests/migration/s390x/a-b-bios.c tests/plugin/bb.c tests/plugin/empty.c tests/plugin/insn.c tests/plugin/mem.c tests/test-rcu-simpleq.c tests/test-rcu-slist.c tests/test-rcu-tailq.c tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c contrib/plugins/, tests/plugin/, and tests/test-rcu-slist.c appear not to include osdep.h intentionally. The remaining reverts are the same as in commit bbfff196. Signed-off-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20201113061216.2483385-1-armbru@redhat.com> Acked-by:
Paolo Bonzini <pbonzini@redhat.com> Acked-by:
Dr. David Alan Gilbert <dgilbert@redhat.com> Tested-by:
Thomas Huth <thuth@redhat.com> Acked-by:
Cornelia Huck <cohuck@redhat.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Acked-by:
Alexander Bulekov <alxndr@bu.edu>
-
- Nov 17, 2020
-
-
Philippe Mathieu-Daudé authored
Fix Coverity CID 1435957: Memory - illegal accesses (OVERRUN): >>> Overrunning array "suffixes" of 7 8-byte elements at element index 7 (byte offset 63) using index "idx" (which evaluates to 7). Note, the biggest input value freq_to_str() can accept is UINT64_MAX, which is ~18.446 EHz, less than 1000 EHz. Reported-by:
Eduardo Habkost <ehabkost@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Reviewed-by:
Eduardo Habkost <ehabkost@redhat.com> Reviewed-by:
Luc Michel <luc@lmichel.fr> Message-id: 20201101215755.2021421-1-f4bug@amsat.org Suggested-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by:
Peter Maydell <peter.maydell@linaro.org>
-
- Nov 16, 2020
-
-
David Hildenbrand authored
Currently, when using "nvme://" for a block device, like -drive file=nvme://0000:01:00.0/1,if=none,id=drive0 \ -device virtio-blk,drive=drive0 \ VFIO may pin all guest memory, and discarding of RAM no longer works as expected. I was able to reproduce this easily with my 01:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981/PM983 Similar to common VFIO, we have to disable it, making sure that: a) virtio-balloon won't discard any memory ("silently disabled") b) virtio-mem and nvme:// run mutually exclusive Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: "Michael S. Tsirkin" <mst@redhat.com> Cc: Alex Williamson <alex.williamson@redhat.com> Cc: Wei Yang <richardw.yang@linux.intel.com> Cc: Dr. David Alan Gilbert <dgilbert@redhat.com> Cc: Igor Mammedov <imammedo@redhat.com> Cc: Pankaj Gupta <pankaj.gupta.linux@gmail.com> Cc: Peter Xu <peterx@redhat.com> Signed-off-by:
David Hildenbrand <david@redhat.com> Message-Id: <20201116105947.9194-1-david@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
- Nov 15, 2020
-
-
Chetan Pant authored
There is no "version 2" of the "Lesser" General Public License. It is either "GPL version 2.0" or "Lesser GPL version 2.1". This patch replaces all occurrences of "Lesser GPL version 2" with "Lesser GPL version 2.1" in comment section. This patch contains all the files, whose maintainer I could not get from ‘get_maintainer.pl’ script. Signed-off-by:
Chetan Pant <chetan4windows@gmail.com> Message-Id: <20201023124424.20177-1-chetan4windows@gmail.com> Reviewed-by:
Thomas Huth <thuth@redhat.com> [thuth: Adapted exec.c and qdev-monitor.c to new location] Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
Chetan Pant authored
There is no "version 2" of the "Lesser" General Public License. It is either "GPL version 2.0" or "Lesser GPL version 2.1". This patch replaces all occurrences of "Lesser GPL version 2" with "Lesser GPL version 2.1" in comment section. Signed-off-by:
Chetan Pant <chetan4windows@gmail.com> Message-Id: <20201023123624.19891-1-chetan4windows@gmail.com> Reviewed-by:
Stefan Weil <sw@weilnetz.de> Signed-off-by:
Thomas Huth <thuth@redhat.com>
-
- Nov 04, 2020
-
-
Paolo Bonzini authored
OptsVisitor, StringInputVisitor and the keyval visitor have three different ideas of how a human could write the value of a boolean option. Pay homage to the backwards-compatibility gods and make the new common helper accept all four sets (on/off, true/false, y/n and yes/no), but remove case-insensitivity. Since OptsVisitor is supposed to match qemu-options, adjust it as well. Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Daniel P. Berrangé <berrange@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Message-Id: <20201103161339.447118-1-pbonzini@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Marc-André Lureau authored
The assert() was added in commit b681a1c7 ("block: Repair the throttling code."), when the qemu_co_queue_do_restart() function required to be running in a coroutine. It was later made unnecessary in commit a9d92355 ("coroutine-lock: reschedule coroutine on the AioContext it was running on"). Signed-off-by:
Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Gerd Hoffmann <kraxel@redhat.com> Message-id: 20201027133602.3038018-2-marcandre.lureau@redhat.com Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com>
-
- Nov 03, 2020
-
-
Stefan Hajnoczi authored
Make it possible to compile out the vhost-user-blk server. It is enabled by default on Linux. Note that vhost-user-server.c depends on libvhost-user, which requires CONFIG_LINUX. The CONFIG_VHOST_USER dependency was erroneous since that option controls vhost-user frontends (previously known as "master") and not device backends (previously known as "slave"). Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20201027173528.213464-3-stefanha@redhat.com> Reviewed-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Michael S. Tsirkin <mst@redhat.com>
-
Philippe Mathieu-Daudé authored
mmap(2) states: 'offset' must be a multiple of the page size as returned by sysconf(_SC_PAGE_SIZE). Add an assertion to be sure we don't break this contract. Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-8-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Philippe Mathieu-Daudé authored
The QEMU_VFIO_DEBUG definition is only modifiable at build-time. Trace events can be enabled at run-time. As we prefer the latter, convert qemu_vfio_dump_mappings() to use trace events instead of fprintf(). Reviewed-by:
Fam Zheng <fam@euphon.net> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-7-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Philippe Mathieu-Daudé authored
For debugging purpose, trace where DMA regions are mapped. Reviewed-by:
Fam Zheng <fam@euphon.net> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-6-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Philippe Mathieu-Daudé authored
For debugging purpose, trace where a BAR is mapped. Reviewed-by:
Fam Zheng <fam@euphon.net> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-5-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Philippe Mathieu-Daudé authored
For debug purpose, trace BAR regions info. Reviewed-by:
Fam Zheng <fam@euphon.net> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-4-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Philippe Mathieu-Daudé authored
We sometime get kernel panic with some devices on Aarch64 hosts. Alex Williamson suggests it might be broken PCIe root complex. Add trace event to record the latest I/O access before crashing. In case, assert our accesses are aligned. Reviewed-by:
Fam Zheng <fam@euphon.net> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-3-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Philippe Mathieu-Daudé authored
Change the confuse "VFIO IOMMU check failed" error message by the explicit "VFIO IOMMU Type1 is not supported" once. Example on POWER: $ qemu-system-ppc64 -drive if=none,id=nvme0,file=nvme://0001:01:00.0/1,format=raw qemu-system-ppc64: -drive if=none,id=nvme0,file=nvme://0001:01:00.0/1,format=raw: VFIO IOMMU Type1 is not supported Suggested-by:
Alex Williamson <alex.williamson@redhat.com> Reviewed-by:
Fam Zheng <fam@euphon.net> Reviewed-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20201103020733.2303148-2-philmd@redhat.com Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Tested-by:
Eric Auger <eric.auger@redhat.com>
-
Volker Rümelin authored
Commit 9ce44e2c "qmp: Move dispatcher to a coroutine" modified aio_poll() in util/aio-posix.c to avoid an assertion failure. This change is missing in util/aio-win32.c. Apply the changes to util/aio-posix.c to util/aio-win32.c too. This fixes an assertion failure on Windows whenever QEMU exits. $ ./qemu-system-x86_64.exe -machine pc,accel=tcg -display gtk ** ERROR:../qemu/util/aio-win32.c:337:aio_poll: assertion failed: (in_aio_context_home_thread(ctx)) Bail out! ERROR:../qemu/util/aio-win32.c:337:aio_poll: assertion failed: (in_aio_context_home_thread(ctx)) Fixes: 9ce44e2c ("qmp: Move dispatcher to a coroutine") Signed-off-by:
Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20201021064033.8600-1-vr_qemu@t-online.de> Tested-by:
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Paolo Bonzini authored
Memory returned by get_relocated_path must be freed with free or g_free depending on the path that the function took; Coverity takes exception to this practice. The fix lets caller use g_free as is standard in QEMU. While at it, mention the requirements on the caller in the doc comment. Suggested-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
-
Markus Armbruster authored
The abstract socket namespace is a non-portable Linux extension. An attempt to use it elsewhere should fail with ENOENT (the abstract address looks like a "" pathname, which does not resolve). We report this failure like Failed to connect socket abc: No such file or directory Tolerable, although ENOTSUP would be better. However, introspection lies: it has @abstract regardless of host support. Easy enough to fix: since Linux provides them since 2.2, 'if': 'defined(CONFIG_LINUX)' should do. The above failure becomes Parameter 'backend.data.addr.data.abstract' is unexpected I consider this an improvement. Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Markus Armbruster authored
unix_listen_saddr() replaces empty @path by unique value. It obtains the value by creating and deleting a unique temporary file with mkstemp(). This is racy, as the comment explains. It's also entirely undocumented as far as I can tell. Goes back to commit d247d25f "sockets: helper functions for qemu (Gerd Hoffman)", v0.10.0. Since abstract socket addresses have no connection with filesystem pathnames, making them up with mkstemp() seems inappropriate. Bypass the replacement of empty @path. Reviewed-by:
Eric Blake <eblake@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Markus Armbruster authored
Commit 776b97d3 "qemu-sockets: add abstract UNIX domain socket support" neglected to update socket_sockaddr_to_address_unix(). The function returns a non-abstract socket address for abstract sockets (wrong) with a null @path (also wrong; a non-optional QAPI str member must never be null). The null @path is due to confused code going back all the way to commit 17c55dec "sockets: add helpers for creating SocketAddress from a socket". Add the required special case, and simplify the confused code. Fixes: 776b97d3 Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Markus Armbruster authored
An optional bool member of a QAPI struct can be false, true, or absent. The previous commit demonstrated that socket_listen() and socket_connect() are broken for absent @tight, and indeed QMP chardev- add also defaults absent member @tight to false instead of true. In C, QAPI members are represented by two fields, has_MEMBER and MEMBER. We have: has_MEMBER MEMBER false true false true true true absent false false/ignore When has_MEMBER is false, MEMBER should be set to false on write, and ignored on read. For QMP, the QAPI visitors handle absent @tight by setting both @has_tight and @tight to false. unix_listen_saddr() and unix_connect_saddr() however use @tight only, disregarding @has_tight. This is wrong and means that absent @tight defaults to false whereas it should default to true. The same is true for @has_abstract, though @abstract defaults to false and therefore has the same behavior for all of QMP, HMP and CLI. Fix unix_listen_saddr() and unix_connect_saddr() to check @has_abstract/@has_tight, and to default absent @tight to true. However, this is only half of the story. HMP chardev-add and CLI -chardev so far correctly defaulted @tight to true, but defaults to false again with the above fix for HMP and CLI. In fact, the "tight" and "abstract" options now break completely. Digging deeper, we find that qemu_chr_parse_socket() also ignores @has_tight, leaving it false when it sets @tight. That is also wrong, but the two wrongs cancelled out. Fix qemu_chr_parse_socket() to set @has_tight and @has_abstract; writing testcases for HMP and CLI is left for another day. Fixes: 776b97d3 Reported-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Paolo Bonzini <pbonzini@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
- Oct 29, 2020
-
-
Daniel P. Berrangé authored
Reporting "Failed to connect socket" is essentially useless for a user attempting to diagnose failure. It needs to include the target address details. Similarly when failing to create a socket we should include the socket family info, so the user understands what particular feature was missing in their kernel build (IPv6, VSock in particular). Reviewed-by:
Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by:
Daniel P. Berrangé <berrange@redhat.com>
-
Gerd Hoffmann authored
We want missing symbols fail module load right away instead of having qemu abort later on in case lazy binding fails. Can happen -- for example -- when trying to load a module for a pci device (virtio-gpu-pci) into a qemu without pci support (qemu-system-avr). Signed-off-by:
Gerd Hoffmann <kraxel@redhat.com> Message-id: 20201028054944.5772-1-kraxel@redhat.com
-