d2dfe0b5 | 19-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
meson: subprojects: replace berkeley-{soft,test}float-3 with wraps
Unlike other subprojects, these require an overlay directory to include meson rules to build the libraries. The rules are basicall
meson: subprojects: replace berkeley-{soft,test}float-3 with wraps
Unlike other subprojects, these require an overlay directory to include meson rules to build the libraries. The rules are basically lifted from tests/fp/meson.build, with a few changes to create platform.h and publish a dependency.
The build defines are passed through a subproject option, and posted back to users of the library via the dependency's compile_args.
The only remaining user of GIT_SUBMODULES and GIT_SUBMODULES_ACTION is roms/SLOF, which is used to build pc-bios/s390-ccw. All other roms submodules are only present to satisfy the license on pre-built firmware blobs.
Best reviewed with --color-moved.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
2019cabf | 18-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
meson: subprojects: replace submodules with wrap files
Compared to submodules, .wrap files have several advantages:
* option parsing and downloading is delegated to meson
* the commit is stored in
meson: subprojects: replace submodules with wrap files
Compared to submodules, .wrap files have several advantages:
* option parsing and downloading is delegated to meson
* the commit is stored in a text file instead of a magic entry in the git tree object
* we could stop shipping external dependencies that are only used as a fallback, but not break compilation on platforms that lack them. For example it may make sense to download dtc at build time, controlled by --enable-download, even when building from a tarball. Right now, this patch does the opposite: make-release treats dtc like libvfio-user (which is not stable API and therefore hasn't found its way into any distros) and keycodemap (which is a copylib, for better or worse).
dependency() can fall back to a wrap automatically. However, this is only possible for libraries that come with a .pc file, and this is not very common for libfdt even though the upstream project in principle provides it; it also removes the control that we provide with --enable-fdt={system,internal}. Therefore, the logic to pick system vs. internal libfdt is left untouched.
--enable-fdt=git is removed; it was already a synonym for --enable-fdt=internal.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
c53648ab | 18-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
meson: use subproject for keycodemapdb
By using a subproject, our own meson.build can use variables from the subproject instead of hard-coded paths. This is also the first step towards managing dow
meson: use subproject for keycodemapdb
By using a subproject, our own meson.build can use variables from the subproject instead of hard-coded paths. This is also the first step towards managing downloads with .wrap files instead of submodule.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
58e48b2e | 18-May-2023 |
Paolo Bonzini <pbonzini@redhat.com> |
meson: use subproject for internal libfdt
Recent dtc/libfdt can use either Make or meson as the build system. By using a subproject, our own meson.build can remove the hard coded list of source file
meson: use subproject for internal libfdt
Recent dtc/libfdt can use either Make or meson as the build system. By using a subproject, our own meson.build can remove the hard coded list of source files.
This is also the first step towards managing downloads with .wrap files instead of submodule.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
9c191605 | 10-Feb-2023 |
Carlos López <clopez@suse.de> |
libvhost-user: check for NULL when allocating a virtqueue element
Check the return value for malloc(), avoiding a NULL pointer dereference, and propagate error in function callers.
Found with GCC 1
libvhost-user: check for NULL when allocating a virtqueue element
Check the return value for malloc(), avoiding a NULL pointer dereference, and propagate error in function callers.
Found with GCC 13 and -fanalyzer:
../subprojects/libvhost-user/libvhost-user.c: In function ‘virtqueue_alloc_element’: ../subprojects/libvhost-user/libvhost-user.c:2556:19: error: dereference of possibly-NULL ‘elem’ [CWE-690] [-Werror=analyzer-possible-null-dereference] 2556 | elem->out_num = out_num; | ~~~~~~~~~~~~~~^~~~~~~~~ ‘virtqueue_alloc_element’: event 1 | | 2554 | assert(sz >= sizeof(VuVirtqElement)); | | ^~~~~~ | | | | | (1) following ‘true’ branch (when ‘sz > 31’)... | ‘virtqueue_alloc_element’: events 2-4 | | 2555 | elem = malloc(out_sg_end); | | ^~~~ ~~~~~~~~~~~~~~~~~~ | | | | | | | (3) this call could return NULL | | (2) ...to here | 2556 | elem->out_num = out_num; | | ~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (4) ‘elem’ could be NULL: unchecked value from (3) |
Signed-off-by: Carlos López <clopez@suse.de> Message-Id: <20230210112514.16858-1-clopez@suse.de> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
show more ...
|
8d5666d7 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvduse: Add extra compiler warnings
In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early
libvduse: Add extra compiler warnings
In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <08daa1896ad8824e17d57d6a970bc0b4bee73ece.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
722b62d9 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Add extra compiler warnings
In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues e
libvhost-user: Add extra compiler warnings
In case libvhost-user is used externally, that projects compiler warnings might be more strict. Enforce an extra set of compiler warnings to catch issues early on.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <737ebf2e697f8640558e6f73d96a692711f548f6.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
950a2f2e | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Fix assignment in vring_set_avail_event
Since it was proposed to change the code in libvduse.c to use memcpy instead of an assignment, the code in libvhost-user.c should also be chang
libvhost-user: Fix assignment in vring_set_avail_event
Since it was proposed to change the code in libvduse.c to use memcpy instead of an assignment, the code in libvhost-user.c should also be changed to use memcpy.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <502b22723264db064e4b05008233a9c1f2f8aaaa.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
86e61e42 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvduse: Fix assignment in vring_set_avail_event
Since the assignment is causing a compiler warning, fix it by using memcpy instead.
CC libvduse.o libvduse.c: In function ‘vring_set_avail_
libvduse: Fix assignment in vring_set_avail_event
Since the assignment is causing a compiler warning, fix it by using memcpy instead.
CC libvduse.o libvduse.c: In function ‘vring_set_avail_event’: libvduse.c:603:7: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasin] 603 | *((uint16_t *)&vq->vring.used->ring[vq->vring.num]) = htole16(val); | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Suggested-by: Xie Yongji <xieyongji@bytedance.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <4a0fe2a6436464473119fdbf0bc4076b36fbb37f.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
85899f8e | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
It seems there is no need to keep the inuse field signed and end up with compiler warnings for sign-compare.
CC libvdus
libvduse: Switch to unsigned int for inuse field in struct VduseVirtq
It seems there is no need to keep the inuse field signed and end up with compiler warnings for sign-compare.
CC libvduse.o libvduse.c: In function ‘vduse_queue_pop’: libvduse.c:789:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘unsigned int’ [-Werror=sign-compare] 789 | if (vq->inuse >= vq->vring.num) { | ^~
Instead of casting the comparison to unsigned int, just make the inuse field unsigned int in the fist place.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Xie Yongji <xieyongji@bytedance.com> Message-Id: <9fe3fd8b042e048bd04d506ca6e43d738b5c45b7.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
518ac428 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
When the libvduse sources are used by another project, it can not be guaranteed that _GNU_SOURCE is set by the build system. If it is for
libvduse: Provide _GNU_SOURCE when compiling outside of QEMU
When the libvduse sources are used by another project, it can not be guaranteed that _GNU_SOURCE is set by the build system. If it is for example not set, errors like this show up.
CC libvduse.o libvduse.c: In function ‘vduse_log_get’: libvduse.c:172:9: error: implicit declaration of function ‘ftruncate’; did you mean ‘strncat’? [-Werror=implicit-function-declaration] 172 | if (ftruncate(fd, size) == -1) { | ^~~~~~~~~ | strncat
The simplest way to allow external complication of libvduse.[ch] by setting _GNU_SOURCE if it is not already set by the build system.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Message-Id: <407f3665f0605df936e5bfe60831d180edfb8cca.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
f1c563d2 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
The assignment of dev->postcopy_ufd can be moved into an else clause and then the code becomes C90 compliant.
CC
libvhost-user: Change dev->postcopy_ufd assignment to make it C90 compliant
The assignment of dev->postcopy_ufd can be moved into an else clause and then the code becomes C90 compliant.
CC libvhost-user.o libvhost-user.c: In function ‘vu_set_postcopy_advise’: libvhost-user.c:1625:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] 1625 | struct uffdio_api api_struct; | ^~~~~~
Understandable, it might be desired to avoid else clauses, but in this case it seems clear enough and frankly the dev->postcopy_ufd is only assigned once.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <74db52afb1203c4580ffc7fa462b4b2ba260a353.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
d87a6424 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Declare uffdio_register early to make it C90 compliant
When using libvhost-user source in an external project that wants to comply with the C90 standard, it is best to declare variabl
libvhost-user: Declare uffdio_register early to make it C90 compliant
When using libvhost-user source in an external project that wants to comply with the C90 standard, it is best to declare variables before code.
CC libvhost-user.o libvhost-user.c: In function ‘generate_faults’: libvhost-user.c:683:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] 683 | struct uffdio_register reg_struct; | ^~~~~~
In this case, it is also simple enough and doesn't cause any extra ifdef additions.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <556c2d00c01fa134d13c0371d4014c90694c2943.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
92bf2461 | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Use unsigned int i for some for-loop iterations
The sign-compare warning also hits some of the for-loops, but it easy fixed by just making the iterator variable unsigned int.
CC
libvhost-user: Use unsigned int i for some for-loop iterations
The sign-compare warning also hits some of the for-loops, but it easy fixed by just making the iterator variable unsigned int.
CC libvhost-user.o libvhost-user.c: In function ‘vu_gpa_to_va’: libvhost-user.c:223:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 223 | for (i = 0; i < dev->nregions; i++) { | ^
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Message-Id: <decb925e1a6fb9538738d2570bda2804f888fa15.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
18fa7f1e | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Cast rc variable to avoid compiler warning
The assert from recvmsg() return value against an uint32_t size field from a protocol struct throws a compiler warning.
CC libvhost
libvhost-user: Cast rc variable to avoid compiler warning
The assert from recvmsg() return value against an uint32_t size field from a protocol struct throws a compiler warning.
CC libvhost-user.o In file included from libvhost-user.c:27: libvhost-user.c: In function ‘vu_message_read_default’: libvhost-user.c:363:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare] 363 | assert(rc == vmsg->size); | ^~
This is not critical, but annoying when the libvhost-user source are used in an external project that has this compiler warning switched on.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Message-Id: <7a791e27b7bd3e0a8b8cc8fbb15090a870d226d5.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
aa5d395a | 22-Dec-2022 |
Marcel Holtmann <marcel@holtmann.org> |
libvhost-user: Replace typeof with __typeof__
Strictly speaking only -std=gnu99 support the usage of typeof and for easier inclusion in external projects, it is better to use __typeof__.
CC
libvhost-user: Replace typeof with __typeof__
Strictly speaking only -std=gnu99 support the usage of typeof and for easier inclusion in external projects, it is better to use __typeof__.
CC libvhost-user.o libvhost-user.c: In function ‘vu_log_queue_fill’: libvhost-user.c:86:13: error: implicit declaration of function ‘typeof’ [-Werror=implicit-function-declaration] 86 | typeof(x) _min1 = (x); \ | ^~~~~~
Changing these two users of typeof makes the compiler happy and no extra flags or pragmas need to be provided.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <981aa822bcaaa2b8d74f245339a99a85c25b346f.1671741278.git.marcel@holtmann.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
show more ...
|
52a57d8d | 26-Nov-2022 |
Stefan Weil via <qemu-devel@nongnu.org> |
libvhost-user: Add format attribute to local function vu_panic
Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220422070144.10
libvhost-user: Add format attribute to local function vu_panic
Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220422070144.1043697-4-sw@weilnetz.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20221126152507.283271-5-sw@weilnetz.de>
show more ...
|