Commit Graph
29 Commits
Author SHA1 Message Date
Anthony PERARD acaecf31ea Update CHANGELOG and README with dependency on json-c
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-10-06 12:36:59 +01:00
Anthony PERARD c71d8ef0cc configure: Use json-c by default, fallback to yajl
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-10-06 12:36:59 +01:00
Anthony PERARD c4abe30ca6 tools/libxenstat: Use json-c when available
This is mainly a copy of the existing code in yajl and use json-c
instead.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-10-06 12:36:59 +01:00
Anthony PERARD 75fa670e58 libxl: Convert libxl__json_object_to_json() to json_object
But keep the implementation done for YAJL.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-10-06 12:36:55 +01:00
Anthony PERARD f6c6f2679d libxl: Convert libxl__object_to_json() to json-c
- libxl changes:

While doing so, we rename all "*_gen_json" function to "*_gen_jso" as
they have different prototype. All the function pointer are been cast
to (libxl__gen_json_callback) by "gentypes.py" when generating
"*_to_json()" functions.

We also introduce a few more "*_gen_jso" functions for "int" and
"bool" because we can't use json_object_*() functions from json-c
directly like it's done with yajl.

To make the generation of _libxl_types*json.[ch] with both YAJL and
json-c we add "--libjsonc" to gentypes.py so it can generate
functions/types for both.

Also introducing "jsonc_json_gen_fn" in the IDL, to be able to point
to a different function when using json-c.

Also, don't export any of the new *_gen_jso() function, at the cost of
having "_hidden" macro in semi-public headers.

- xl changes:

Also, rework the implementation of printf_info() in `xl` to avoid
using libxl_domain_config_gen_json() which isn't available without
YAJL. The implementation using "json_object" call
libxl_domain_config_to_json() which generate a plain string of JSON,
which we parse to add it to our own json; this avoid a dependency on
the json library used by libxl.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-10-06 12:36:50 +01:00
Anthony PERARD a6fd4a1c55 libxl: Convert libxl__json_object_to_yajl_gen to libxl__json_object_to_libjsonc_object
Convert yajl_gen to json_object from lib json-c.

And make use of it in qmp_prepare_cmd(), which can be compiled with
either lib.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-10-06 12:36:44 +01:00
Anthony PERARD 7e95dab9eb libxl: Convert libxl__json_parse() to use json-c
This reuse the "json_callback_*" implemented for the yajl parser as
they don't really need to be changed. It's just awkward to have to
cast between `unsigned char` and `char.`

Replace few strncpy() by memcpy() to let the compiler know we want to
copy the string without the terminating nul, as we are adding it just
after.

Also, it should be possible to keep using YAJL parser when json-c
library isn't available.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-10-06 12:28:43 +01:00
Anthony PERARD bb3da1c885 tools/configure: Introduce deps on json-c lib for libxl
To replace yajl.

Introduce XEN_JSON_LIBS variable, to be able to remove "-lyajl" later.

As a first step, the variable will have both or only -lyajl. Then
commit "configure: Use json-c by default, fallback to yajl" will make
a change to only have one or the other once the code is ready to build
with only json-c.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-10-06 12:28:43 +01:00
Anthony PERARD ccb11468b6 libxl: remove duplicated libxl__yajl_gen_asciiz() prototype
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-09-04 14:26:44 +02:00
Anthony PERARD f5aadd575b libxl: Remove duplicate libxl_domain_config_gen_json prototype
Since f9e681d3d1, the prototype of libxl_domain_config_gen_json is
generated from IDL in _libxl_types_json.h.

Fixes: f9e681d3d1 ("libxl: move definition of libxl_domain_config into the IDL")
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-09-04 14:26:38 +02:00
Anthony PERARD e5843b4020 xl: move printf_info prototype to an header
In a single place.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2025-09-04 14:26:26 +02:00
Anthony PERARD ca04a92ec1 CI: Add and use ccache in build-each-commit job
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
2025-08-01 13:47:18 +02:00
Anthony PERARD 321b74f29d CI: Add timing to junit
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-06-06 12:07:26 +02:00
Anthony PERARD 1cdf180308 CI: Fix status check for tools/tests
Without "pipefail", $? have the exit value of `tee`, which should
always be 0. But instead of using "pipefail", do collect the value of
from the test with $PIPESTATUS.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-06-06 12:06:34 +02:00
Anthony PERARD a6eb429d51 CI: Use CDATA avoid the need to escape tests outputs
This is easier than escaping individual characters, especially '&'
and '<' which are problematic if present.

We might still need to escape ']]>' if this string is present in the
test output, but hopefully not.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-06-06 12:04:05 +02:00
Anthony PERARD ddf34d4bb8 tools/tests: Fix return value of test-rangeset
Otherwise, failed tests are ignored by automated test.

Fixes: 7bf777b42c ("tootls/tests: introduce unit tests for rangesets")
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-06-06 12:00:40 +02:00
Anthony PERARD 89a5fbb8e3 CI: Add SELECTED_JOBS_ONLY to analyze.yaml
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-06-06 12:00:28 +02:00
Anthony PERARD a5d0e9c901 tools/tests: Fix newly introduced Makefile
Fix few issue with this new directory:
- clean generated files
- and ignore those generated files
- include the dependency files generated by `gcc`.
- rework prerequisites:
  "test-rangeset.o" also needs the generated files "list.h" and
  "rangeset.h". Technically, both only needs "harness.h" which needs
  the generated headers, but that's a bit simpler and the previous
  point will add the dependency on "harness.h" automatically.

This last point fix an issue where `make` might decide to build
"test-rangeset.o" before the other files are ready.

Fixes: 7bf777b42c ("tootls/tests: introduce unit tests for rangesets")
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
2025-04-25 11:44:03 +02:00
Anthony PERARD e43d9621d8 automation: Avoid changing source files for randconfig tests
We should avoid changing files from the source tree if we don't intend
to commit the result.

We don't really need to check if $EXTRA_FIXED_RANDCONFIG is empty so
add it to the temporary file in all cases.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-04-25 11:26:29 +02:00
Anthony PERARD dc0da10be6 CI: Change pipeline name for scheduled pipeline
This description is already displayed on the web UI of the list of
pipeline, but using it as "name" will make it available in webhooks as
well and can be used by a bot.

This doesn't change the behavior for other pipeline types, where the
variable isn't set.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
2025-03-28 11:04:16 +01:00
Anthony PERARD 1e18f132af kconfig/randconfig: Remove non-existing config
CONFIG_GCOV_FORMAT_AUTODETECT has been removed in 767e6c5fd5.

Fixes: 767e6c5fd5 ("kconfig/gcov: remove gcc version choice from kconfig")
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2025-03-28 11:00:31 +01:00
Anthony PERARD 5cc971a4bf CI: New stage "containers" to rebuild some containers
Rebuild rolling release containers when XEN_CI_REBUILD_CONTAINERS is
set. This is to be use with a scheduled pipeline.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-11-19 13:47:25 -08:00
Anthony PERARD a231538acd CI: Define XEN_REGISTRY variable
This allow to change the registry used for container in a single
place, and could be controlled via other mean.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-11-19 13:45:58 -08:00
Anthony PERARD 5726d8e5ef CI: Remove deprecated "only:variables" in favor of "rules:if"
Also, this prevent using "rules", like in the ".test-jobs-common"
template.

https://docs.gitlab.com/ee/ci/yaml/#only--except

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2024-11-19 13:45:49 -08:00
Anthony PERARD 457052167b blkif: Fix a couple of typos
Those where fixed in OVMF's copy. (And one of them fixed in QEMU's
copy but later discarded by an update.)

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2024-09-26 14:18:03 +01:00
Anthony PERARD e9a0101dde blkif: Fix alignment description for discard request
The discard feature have an other xenstore node to described the size
of the blocks than can be discarded, "discard-granularity", which
default to "sector-size" when absent as noted in the properties and in
note 4. So discard request should be aligned on this value.

Fixes: 221f2748e8 ("blkif: reconcile protocol specification with in-use implementations")
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2024-09-26 14:18:03 +01:00
Anthony PERARD 1436593d5f libxl: Probe QEMU for -run-with user=user and use it
"-runas" is deprecated since QEMU 9.1 and will be remove in a future
release.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2024-08-30 18:14:11 +01:00
Anthony PERARD 82335a8cc5 libxl: Probe QEMU for -run-with chroot=dir and use it
QEMU 9.0 have removed "-chroot" command line option, which have been
deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".

Look into the result of the QMP command "query-command-line-options"
to find out if "-run-with chroot=dir" is available. Then use it in
place of "-chroot".

Resolves: xen-project/xen#187
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
2024-08-30 18:14:11 +01:00
Anthony PERARD 93db2f64f3 MAINTAINERS: Update my email address again
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Release-Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
2024-06-25 11:36:15 +02:00