[libvirt PATCH 00/20] Switch to json-c from yajl

As requested by: https://gitlab.com/libvirt/libvirt/-/issues/581 The ci update depends on the following libvirt-ci MR: https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/497 targets: bump OpenSUSE Leap to 15.6 Pipeline: https://gitlab.com/janotomko/libvirt/-/pipelines/1413887401/ Ján Tomko (20): tests: json: relax some test cases ci: update OpenSUSE Leap to 15.6 util: json: introduce virJSONStringPrettifyBlanks tests: switch to compact empty JSON object formatting meson: add option for building with json-c meson: link libvirt with json_c if available util: json: write a json-c implementation ci: install json-c too meson: nss: link with json-c if available nss: convert findLeases to use json-c nss: convert findMACs to use json-c tests: depend on WITH_JSON_C instead of WITH_YAJL meson: switch checks to depend on json-c instead of yajl meson-options: switch to depend on json-c instead of yajl libvirt-spec: switch to building with json-c meson: do not link anything with yajl anymore meson: options: drop yajl meson: drop yajl detection util: drop dead code ci: drop yajl completely ci/buildenv/almalinux-9.sh | 4 +- ci/buildenv/alpine-319.sh | 4 +- ci/buildenv/alpine-edge.sh | 4 +- ci/buildenv/centos-stream-9.sh | 4 +- ci/buildenv/debian-11-cross-aarch64.sh | 2 +- ci/buildenv/debian-11-cross-armv6l.sh | 2 +- ci/buildenv/debian-11-cross-armv7l.sh | 2 +- ci/buildenv/debian-11-cross-i686.sh | 2 +- ci/buildenv/debian-11-cross-mips64el.sh | 2 +- ci/buildenv/debian-11-cross-mipsel.sh | 2 +- ci/buildenv/debian-11-cross-ppc64le.sh | 2 +- ci/buildenv/debian-11-cross-s390x.sh | 2 +- ci/buildenv/debian-11.sh | 2 +- ci/buildenv/debian-12-cross-aarch64.sh | 2 +- ci/buildenv/debian-12-cross-armv6l.sh | 2 +- ci/buildenv/debian-12-cross-armv7l.sh | 2 +- ci/buildenv/debian-12-cross-i686.sh | 2 +- ci/buildenv/debian-12-cross-mips64el.sh | 2 +- ci/buildenv/debian-12-cross-mipsel.sh | 2 +- ci/buildenv/debian-12-cross-ppc64le.sh | 2 +- ci/buildenv/debian-12-cross-s390x.sh | 2 +- ci/buildenv/debian-12.sh | 2 +- ci/buildenv/debian-sid-cross-aarch64.sh | 2 +- ci/buildenv/debian-sid-cross-armv6l.sh | 2 +- ci/buildenv/debian-sid-cross-armv7l.sh | 2 +- ci/buildenv/debian-sid-cross-i686.sh | 2 +- ci/buildenv/debian-sid-cross-mips64el.sh | 2 +- ci/buildenv/debian-sid-cross-ppc64le.sh | 2 +- ci/buildenv/debian-sid-cross-s390x.sh | 2 +- ci/buildenv/debian-sid.sh | 2 +- ci/buildenv/fedora-39.sh | 4 +- ci/buildenv/fedora-40.sh | 4 +- ci/buildenv/fedora-rawhide.sh | 4 +- ci/buildenv/opensuse-leap-15.sh | 2 +- ci/buildenv/opensuse-tumbleweed.sh | 2 +- ci/buildenv/ubuntu-2204.sh | 2 +- ci/buildenv/ubuntu-2404.sh | 2 +- ci/cirrus/freebsd-13.vars | 2 +- ci/cirrus/freebsd-14.vars | 2 +- ci/cirrus/macos-13.vars | 2 +- ci/cirrus/macos-14.vars | 2 +- ci/containers/almalinux-9.Dockerfile | 4 +- ci/containers/alpine-319.Dockerfile | 4 +- ci/containers/alpine-edge.Dockerfile | 4 +- ci/containers/centos-stream-9.Dockerfile | 4 +- .../debian-11-cross-aarch64.Dockerfile | 2 +- .../debian-11-cross-armv6l.Dockerfile | 2 +- .../debian-11-cross-armv7l.Dockerfile | 2 +- ci/containers/debian-11-cross-i686.Dockerfile | 2 +- .../debian-11-cross-mips64el.Dockerfile | 2 +- .../debian-11-cross-mipsel.Dockerfile | 2 +- .../debian-11-cross-ppc64le.Dockerfile | 2 +- .../debian-11-cross-s390x.Dockerfile | 2 +- ci/containers/debian-11.Dockerfile | 2 +- .../debian-12-cross-aarch64.Dockerfile | 2 +- .../debian-12-cross-armv6l.Dockerfile | 2 +- .../debian-12-cross-armv7l.Dockerfile | 2 +- ci/containers/debian-12-cross-i686.Dockerfile | 2 +- .../debian-12-cross-mips64el.Dockerfile | 2 +- .../debian-12-cross-mipsel.Dockerfile | 2 +- .../debian-12-cross-ppc64le.Dockerfile | 2 +- .../debian-12-cross-s390x.Dockerfile | 2 +- ci/containers/debian-12.Dockerfile | 2 +- .../debian-sid-cross-aarch64.Dockerfile | 2 +- .../debian-sid-cross-armv6l.Dockerfile | 2 +- .../debian-sid-cross-armv7l.Dockerfile | 2 +- .../debian-sid-cross-i686.Dockerfile | 2 +- .../debian-sid-cross-mips64el.Dockerfile | 2 +- .../debian-sid-cross-ppc64le.Dockerfile | 2 +- .../debian-sid-cross-s390x.Dockerfile | 2 +- ci/containers/debian-sid.Dockerfile | 2 +- ci/containers/fedora-39.Dockerfile | 4 +- ci/containers/fedora-40.Dockerfile | 4 +- ci/containers/fedora-rawhide.Dockerfile | 4 +- ci/containers/opensuse-leap-15.Dockerfile | 4 +- ci/containers/opensuse-tumbleweed.Dockerfile | 2 +- ci/containers/ubuntu-2204.Dockerfile | 2 +- ci/containers/ubuntu-2404.Dockerfile | 2 +- ci/gitlab/builds.yml | 2 +- ci/lcitool/projects/libvirt.yml | 2 +- libvirt.spec.in | 6 +- meson.build | 61 +-- meson_options.txt | 8 +- src/libvirt_private.syms | 1 + src/meson.build | 2 +- src/util/meson.build | 2 +- src/util/virjson.c | 481 +++++------------- src/util/virjson.h | 2 + tests/meson.build | 8 +- tests/qemublocktest.c | 5 +- .../backupmerge/empty-out.json | 4 +- tests/qemumigparamsdata/empty.json | 4 +- tests/qemumigparamstest.c | 5 +- tests/virjsontest.c | 9 +- tests/virmacmaptest.c | 5 +- tests/virmacmaptestdata/empty.json | 4 +- tests/virnetdaemontest.c | 2 +- tests/virstoragetest.c | 4 +- tools/nss/libvirt_nss_leases.c | 339 ++++-------- tools/nss/libvirt_nss_macs.c | 263 +++------- tools/nss/meson.build | 4 +- 101 files changed, 447 insertions(+), 962 deletions(-) -- 2.45.2

Some JSON parsers do not like bare types outside of objects or arrays or do validation of object key uniqueness. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tests/virjsontest.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/virjsontest.c b/tests/virjsontest.c index 6b6a64d3d3..efcbbbab98 100644 --- a/tests/virjsontest.c +++ b/tests/virjsontest.c @@ -550,9 +550,9 @@ mymain(void) "[\"The meaning of life\"]"); DO_TEST_PARSE_FAIL("unterminated string", "[ \"The meaning of lif ]"); - DO_TEST_PARSE("integer", "1", NULL); - DO_TEST_PARSE("boolean", "true", NULL); - DO_TEST_PARSE("null", "null", NULL); + DO_TEST_PARSE("integer", "[1]", NULL); + DO_TEST_PARSE("boolean", "[true]", NULL); + DO_TEST_PARSE("null", "[null]", NULL); DO_TEST_PARSE("[]", "[]", NULL); DO_TEST_PARSE("escaping symbols", "[\"\\\"\\t\\n\\\\\"]", NULL); @@ -574,14 +574,11 @@ mymain(void) DO_TEST_PARSE_FAIL("array of an object with an array as a key", "[ {[\"key1\", \"key2\"]: \"value\"} ]"); DO_TEST_PARSE_FAIL("object with unterminated key", "{ \"key:7 }"); - DO_TEST_PARSE_FAIL("duplicate key", "{ \"a\": 1, \"a\": 1 }"); DO_TEST_FULL("lookup on array", Lookup, "[ 1 ]", NULL, false); DO_TEST_FULL("lookup on string", Lookup, "\"str\"", NULL, false); - DO_TEST_FULL("lookup on integer", Lookup, - "1", NULL, false); DO_TEST_FULL("lookup with missing key", Lookup, "{ }", NULL, false); DO_TEST_FULL("lookup with wrong type", Lookup, -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:16 +0200, Ján Tomko wrote:
Some JSON parsers do not like bare types outside of objects or arrays or do validation of object key uniqueness.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tests/virjsontest.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

It was released on June 12, 2024. The update means we no longer have to care about json-c 0.13 present in Leap 15.5, which solves some whitespace issues in tests. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- ci/containers/opensuse-leap-15.Dockerfile | 2 +- ci/gitlab/builds.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/containers/opensuse-leap-15.Dockerfile b/ci/containers/opensuse-leap-15.Dockerfile index bf794d6929..b152528378 100644 --- a/ci/containers/opensuse-leap-15.Dockerfile +++ b/ci/containers/opensuse-leap-15.Dockerfile @@ -4,7 +4,7 @@ # # https://gitlab.com/libvirt/libvirt-ci -FROM registry.opensuse.org/opensuse/leap:15.5 +FROM registry.opensuse.org/opensuse/leap:15.6 RUN zypper update -y && \ zypper install -y \ diff --git a/ci/gitlab/builds.yml b/ci/gitlab/builds.yml index a0a64c1ec1..214119b902 100644 --- a/ci/gitlab/builds.yml +++ b/ci/gitlab/builds.yml @@ -191,7 +191,7 @@ x86_64-opensuse-leap-15: CFLAGS: -Wno-missing-include-dirs NAME: opensuse-leap-15 RPM: skip - TARGET_BASE_IMAGE: registry.opensuse.org/opensuse/leap:15.5 + TARGET_BASE_IMAGE: registry.opensuse.org/opensuse/leap:15.6 x86_64-opensuse-tumbleweed: -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:17 +0200, Ján Tomko wrote:
It was released on June 12, 2024.
The update means we no longer have to care about json-c 0.13 present in Leap 15.5, which solves some whitespace issues in tests.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- ci/containers/opensuse-leap-15.Dockerfile | 2 +- ci/gitlab/builds.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
I've approved https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/497 and Reviewed-by: Peter Krempa <pkrempa@redhat.com>

A horribly named function for unifying formatting when pretty-printing empty JSON arrays and objects. Useful for having stable test output even if different JSON libraries format these differently. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/libvirt_private.syms | 1 + src/util/virjson.c | 34 ++++++++++++++++++++++++++++++++++ src/util/virjson.h | 2 ++ 3 files changed, 37 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0accca442a..01b332a905 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2609,6 +2609,7 @@ virISCSIScanTargets; # util/virjson.h +virJSONStringPrettifyBlanks; virJSONStringReformat; virJSONValueArrayAppend; virJSONValueArrayAppendString; diff --git a/src/util/virjson.c b/src/util/virjson.c index 57707350da..0edf86cd1c 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1861,6 +1861,40 @@ virJSONStringReformat(const char *jsonstr, return virJSONValueToString(json, pretty); } +/** + * virJSONStringPrettifyBlanks: + * @jsonstr: string to prettify + * + * In the pretty mode of printing, various versions of JSON libraries + * format empty arrays and objects differently. + * + * Unify this to "[]" and "{}" which are used by json-c 0.17 and newer. + * https://github.com/json-c/json-c/issues/778 + * + * This format is also used by Python's 'json.dump' method. + * + * Returns the reformatted JSON string on success. + */ +char *virJSONStringPrettifyBlanks(const char *jsonstr) +{ + virBuffer buf = VIR_BUFFER_INITIALIZER; + const char *p; + + for (p = jsonstr; *p && p[1]; p++) { + virBufferAddChar(&buf, *p); + + if ((p[0] == '{' || p[0] == '[') && p[1] == '\n') { + const char *q = p + 1; + + virSkipSpaces(&q); + + if (*q == '}' || *q == ']') + p = q - 1; + } + } + + return virBufferContentAndReset(&buf); +} static virJSONValue * virJSONValueObjectDeflattenKeys(virJSONValue *json); diff --git a/src/util/virjson.h b/src/util/virjson.h index e622798fe7..d8481e5890 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -271,6 +271,8 @@ virJSONValueCopy(const virJSONValue *in); char * virJSONStringReformat(const char *jsonstr, bool pretty); +char * +virJSONStringPrettifyBlanks(const char *jsonstr); virJSONValue * virJSONValueObjectDeflatten(virJSONValue *json); -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:18 +0200, Ján Tomko wrote:
A horribly named function for unifying formatting when pretty-printing empty JSON arrays and objects. Useful for having stable test output even if different JSON libraries format these differently.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/libvirt_private.syms | 1 + src/util/virjson.c | 34 ++++++++++++++++++++++++++++++++++ src/util/virjson.h | 2 ++ 3 files changed, 37 insertions(+)
[...]
diff --git a/src/util/virjson.c b/src/util/virjson.c index 57707350da..0edf86cd1c 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -1861,6 +1861,40 @@ virJSONStringReformat(const char *jsonstr, return virJSONValueToString(json, pretty); }
+/** + * virJSONStringPrettifyBlanks: + * @jsonstr: string to prettify + * + * In the pretty mode of printing, various versions of JSON libraries + * format empty arrays and objects differently. + * + * Unify this to "[]" and "{}" which are used by json-c 0.17 and newer. + * https://github.com/json-c/json-c/issues/778
Ah, I thought that we could drop this along with yajl removal ... too bad. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Some earlier versions of json-c format empty elements differently. Run the tests who use the pretty formatting for readability and diffability through a function that unifies the output. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tests/qemublocktest.c | 5 ++++- tests/qemublocktestdata/backupmerge/empty-out.json | 4 +--- tests/qemumigparamsdata/empty.json | 4 +--- tests/qemumigparamstest.c | 5 ++++- tests/virmacmaptest.c | 5 ++++- tests/virmacmaptestdata/empty.json | 4 +--- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index c581bd1748..6c4e735466 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -720,6 +720,7 @@ testQemuBackupIncrementalBitmapCalculate(const void *opaque) g_autofree char *expectpath = NULL; g_autoptr(virStorageSource) target = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; + g_autofree char *actual = NULL; expectpath = g_strdup_printf("%s/%s%s-out.json", abs_srcdir, backupDataPrefix, data->name); @@ -748,7 +749,9 @@ testQemuBackupIncrementalBitmapCalculate(const void *opaque) virBufferAddLit(&buf, "NULL\n"); } - return virTestCompareToFile(virBufferCurrentContent(&buf), expectpath); + actual = virJSONStringPrettifyBlanks(virBufferCurrentContent(&buf)); + + return virTestCompareToFile(actual, expectpath); } diff --git a/tests/qemublocktestdata/backupmerge/empty-out.json b/tests/qemublocktestdata/backupmerge/empty-out.json index 41b42e677b..fe51488c70 100644 --- a/tests/qemublocktestdata/backupmerge/empty-out.json +++ b/tests/qemublocktestdata/backupmerge/empty-out.json @@ -1,3 +1 @@ -[ - -] +[] diff --git a/tests/qemumigparamsdata/empty.json b/tests/qemumigparamsdata/empty.json index 0db3279e44..0967ef424b 100644 --- a/tests/qemumigparamsdata/empty.json +++ b/tests/qemumigparamsdata/empty.json @@ -1,3 +1 @@ -{ - -} +{} diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c index 5d45a9dd58..67cc14d948 100644 --- a/tests/qemumigparamstest.c +++ b/tests/qemumigparamstest.c @@ -137,6 +137,7 @@ qemuMigParamsTestJSON(const void *opaque) g_autoptr(virJSONValue) paramsIn = NULL; g_autoptr(virJSONValue) paramsOut = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; + g_autofree char *formattedJSON = NULL; g_autofree char *actualJSON = NULL; g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER; @@ -156,9 +157,11 @@ qemuMigParamsTestJSON(const void *opaque) return -1; if (!(paramsOut = qemuMigrationParamsToJSON(migParams, false)) || - !(actualJSON = virJSONValueToString(paramsOut, true))) + !(formattedJSON = virJSONValueToString(paramsOut, true))) return -1; + actualJSON = virJSONStringPrettifyBlanks(formattedJSON); + if (testQEMUSchemaValidateCommand("migrate-set-parameters", paramsOut, data->qmpschema, diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c index 9a28c1bed0..074bc8f659 100644 --- a/tests/virmacmaptest.c +++ b/tests/virmacmaptest.c @@ -118,13 +118,16 @@ testMACFlush(const void *opaque) const struct testData *data = opaque; g_autofree char *file = NULL; g_autofree char *str = NULL; + g_autofree char *actual = NULL; file = g_strdup_printf("%s/virmacmaptestdata/%s.json", abs_srcdir, data->file); if (virMacMapDumpStr(data->mgr, &str) < 0) return -1; - if (virTestCompareToFile(str, file) < 0) + actual = virJSONStringPrettifyBlanks(str); + + if (virTestCompareToFile(actual, file) < 0) return -1; return 0; diff --git a/tests/virmacmaptestdata/empty.json b/tests/virmacmaptestdata/empty.json index 41b42e677b..fe51488c70 100644 --- a/tests/virmacmaptestdata/empty.json +++ b/tests/virmacmaptestdata/empty.json @@ -1,3 +1 @@ -[ - -] +[] -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:19 +0200, Ján Tomko wrote:
Some earlier versions of json-c format empty elements differently. Run the tests who use the pretty formatting for readability and diffability through a function that unifies the output.
Hmm so for test/output stability IMO it'd be better to fix the output inside virJSONValueToString(..., true) (so when we're prettifying). This would cover all existing instances in the tests, but also all future XMLs. Additionally it'd unify the output of prettified JSON we have e.g. in 'virsh qemu-monitor-command --pretty'. Too bad that it basically requires duplicating the output string which makes me think twice whether it's really worth doing. What do you think? Regardless, what's here works: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On a Thursday in 2024, Peter Krempa wrote:
On Wed, Aug 14, 2024 at 23:40:19 +0200, Ján Tomko wrote:
Some earlier versions of json-c format empty elements differently. Run the tests who use the pretty formatting for readability and diffability through a function that unifies the output.
Hmm so for test/output stability IMO it'd be better to fix the output inside virJSONValueToString(..., true) (so when we're prettifying).
This would cover all existing instances in the tests, but also all future XMLs. Additionally it'd unify the output of prettified JSON we have e.g. in 'virsh qemu-monitor-command --pretty'.
Too bad that it basically requires duplicating the output string which makes me think twice whether it's really worth doing.
What do you think?
I don't think the duplication is worth it. And we don't really guarantee stability of the pretty formatting. On the other hand, if the output really is intended for human consumption, the overhead would be negligible. The following systems from our CI need this workaround: AlmaLinux 9: 0.14 CentOS Stream 9: 0.14 Ubuntu 22.04: 0.15 Debian 12: 0.16 OpenSUSE Leap 15.6: 0.16 So we would be able to drop it two years after a new major version of all of these gets out, if I'm remembering our rules right. Jano
Regardless, what's here works:
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Tue, Aug 20, 2024 at 17:04:19 +0200, Ján Tomko wrote:
On a Thursday in 2024, Peter Krempa wrote:
On Wed, Aug 14, 2024 at 23:40:19 +0200, Ján Tomko wrote:
Some earlier versions of json-c format empty elements differently. Run the tests who use the pretty formatting for readability and diffability through a function that unifies the output.
Hmm so for test/output stability IMO it'd be better to fix the output inside virJSONValueToString(..., true) (so when we're prettifying).
This would cover all existing instances in the tests, but also all future XMLs. Additionally it'd unify the output of prettified JSON we have e.g. in 'virsh qemu-monitor-command --pretty'.
Too bad that it basically requires duplicating the output string which makes me think twice whether it's really worth doing.
What do you think?
I don't think the duplication is worth it. And we don't really guarantee stability of the pretty formatting.
Hmm, yeah. This is mostly whether it makes sense to prevent potential spurious CI failures in case we happen to add a JSON output file which would break in any other output path. Debugging that might not be obvious to people who didn't see the function. As said:
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Also disable it immediately for the mingw build because it's not available there. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 1 + meson.build | 7 +++++++ meson_options.txt | 1 + 3 files changed, 9 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 29101e74fe..ad0f4f784f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1441,6 +1441,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dfuse=disabled \ -Dglusterfs=disabled \ -Dhost_validate=disabled \ + -Djson_c=disabled \ -Dlibiscsi=disabled \ -Dnbdkit=disabled \ -Dnbdkit_config_default=disabled \ diff --git a/meson.build b/meson.build index f31485c395..39d6d700d3 100644 --- a/meson.build +++ b/meson.build @@ -1018,6 +1018,12 @@ glusterfs_dep = dependency('glusterfs-api', version: '>=' + glusterfs_version, r gnutls_version = '3.6.0' gnutls_dep = dependency('gnutls', version: '>=' + gnutls_version) +json_c_version = '0.14' +json_c_dep = dependency('json-c', version: '>=' + json_c_version, required: get_option('json_c')) +if json_c_dep.found() + conf.set('WITH_JSON_C', 1) +endif + # Check for BSD kvm (kernel memory interface) if host_machine.system() == 'freebsd' libkvm_dep = cc.find_library('kvm') @@ -2342,6 +2348,7 @@ libs_summary = { 'dlopen': dlopen_dep.found(), 'fuse': fuse_dep.found(), 'glusterfs': glusterfs_dep.found(), + 'json-c': json_c_dep.found(), 'libiscsi': libiscsi_dep.found(), 'libkvm': libkvm_dep.found(), 'libnbd': libnbd_dep.found(), diff --git a/meson_options.txt b/meson_options.txt index 2d440c63d8..9b1610fcfe 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -28,6 +28,7 @@ option('capng', type: 'feature', value: 'auto', description: 'cap-ng support') option('curl', type: 'feature', value: 'auto', description: 'curl support') option('fuse', type: 'feature', value: 'auto', description: 'fuse support') option('glusterfs', type: 'feature', value: 'auto', description: 'glusterfs support') +option('json_c', type: 'feature', value: 'auto', description: 'JSON-C support') option('libiscsi', type: 'feature', value: 'auto', description: 'libiscsi support') option('libnl', type: 'feature', value: 'auto', description: 'libnl support') option('libpcap', type: 'feature', value: 'auto', description: 'libpcap support') -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:20 +0200, Ján Tomko wrote:
Also disable it immediately for the mingw build because it's not available there.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 1 + meson.build | 7 +++++++ meson_options.txt | 1 + 3 files changed, 9 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 29101e74fe..ad0f4f784f 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1441,6 +1441,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dfuse=disabled \ -Dglusterfs=disabled \ -Dhost_validate=disabled \ + -Djson_c=disabled \ -Dlibiscsi=disabled \ -Dnbdkit=disabled \ -Dnbdkit_config_default=disabled \
I'd prefer if you also disable this in the 'native' build and enable it afterwards so that it doesn't depend on auto-detection meanwhile. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/meson.build | 1 + src/util/meson.build | 1 + tests/meson.build | 1 + 3 files changed, 3 insertions(+) diff --git a/src/meson.build b/src/meson.build index 8cce42c7ad..b9652785dd 100644 --- a/src/meson.build +++ b/src/meson.build @@ -552,6 +552,7 @@ if conf.has('WITH_REMOTE') capng_dep, devmapper_dep, gnutls_dep, + json_c_dep, libssh2_dep, libssh_dep, sasl_dep, diff --git a/src/util/meson.build b/src/util/meson.build index 896c795150..ab6942fa81 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -193,6 +193,7 @@ virt_util_lib = static_library( capng_dep, devmapper_dep, gnutls_dep, + json_c_dep, intl_dep, libm_dep, libnl_dep, diff --git a/tests/meson.build b/tests/meson.build index 2f1eda1f95..d1fc122fc7 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -10,6 +10,7 @@ tests_dep = declare_dependency( dlopen_dep, glib_dep, gnutls_dep, + json_c_dep, libnl_dep, libxml_dep, rpc_dep, -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:21 +0200, Ján Tomko wrote:
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/meson.build | 1 + src/util/meson.build | 1 + tests/meson.build | 1 + 3 files changed, 3 insertions(+)
This by itself looks weird. Merge it with the previous patch perhaps?

Write an alternative implementation of our virJSON functions, using json-c instead of yajl. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/util/virjson.c | 177 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 2 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..7a22c54f03 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -32,7 +32,9 @@ #include "virenum.h" #include "virbitmap.h" -#if WITH_YAJL +#if WITH_JSON_C +# include <json.h> +#elif WITH_YAJL # include <yajl/yajl_gen.h> # include <yajl/yajl_parse.h> @@ -1389,8 +1391,179 @@ virJSONValueCopy(const virJSONValue *in) return out; } +#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj) +{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL; -#if WITH_YAJL + switch (type) { + case json_type_null: + ret = virJSONValueNewNull(); + break; + case json_type_boolean: + ret = virJSONValueNewBoolean(json_object_get_boolean(jobj)); + break; + case json_type_double: + case json_type_int: { + ret = virJSONValueNewNumber(g_strdup(json_object_get_string(jobj))); + break; + } + case json_type_object: + ret = virJSONValueNewObject(); + { + json_object_object_foreach(jobj, key, val) { + virJSONValue *cur = virJSONValueFromJsonC(val); + + if (virJSONValueObjectAppend(ret, key, &cur) < 0) { + g_free(ret); + return NULL; + } + } + } + break; + case json_type_array: { + size_t len; + size_t i; + + ret = virJSONValueNewArray(); + len = json_object_array_length(jobj); + + for (i = 0; i < len; i++) { + virJSONValue *cur = NULL; + json_object *val = NULL; + + val = json_object_array_get_idx(jobj, i); + + cur = virJSONValueFromJsonC(val); + + virJSONValueArrayAppend(ret, &cur); + } + break; + } + case json_type_string: + ret = virJSONValueNewString(g_strdup(json_object_get_string(jobj))); + break; + } + + VIR_DEBUG("ret=%p", ret); + return ret; +} + +virJSONValue * +virJSONValueFromString(const char *jsonstring) +{ + json_object *jobj = NULL; + virJSONValue *ret = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; + + VIR_DEBUG("string=%s", jsonstring); + + tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags); + jobj = json_tokener_parse_ex(tok, jsonstring, strlen(jsonstring)); + jerr = json_tokener_get_error(tok); + if (jerr != json_tokener_success) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", json_tokener_error_desc(jerr)); + goto cleanup; + } + ret = virJSONValueFromJsonC(jobj); + + cleanup: + VIR_DEBUG("result=%p", ret); + json_object_put(jobj); + json_tokener_free(tok); + return ret; +} + +static json_object * +virJSONValueToJsonC(virJSONValue *object) +{ + json_object *ret = NULL; + size_t i; + + VIR_DEBUG("object=%p type=%d", object, object->type); + + switch (object->type) { + case VIR_JSON_TYPE_OBJECT: + // constant key? + ret = json_object_new_object(); + for (i = 0; i < object->data.object.npairs; i++) { + json_object *child = virJSONValueToJsonC(object->data.object.pairs[i].value); + json_object_object_add(ret, object->data.object.pairs[i].key, child); + } + return ret; + case VIR_JSON_TYPE_ARRAY: + /* json_object_new_array_ext was introduced in json-c 0.16 */ +# if JSON_C_VERSION_NUM < ((0 << 16) | (16 << 8)) + ret = json_object_new_array(); +# else + ret = json_object_new_array_ext(object->data.array.nvalues); +# endif + for (i = 0; i < object->data.array.nvalues; i++) { + json_object_array_add(ret, + virJSONValueToJsonC(object->data.array.values[i])); + } + return ret; + + case VIR_JSON_TYPE_STRING: + return json_object_new_string(object->data.string); + + case VIR_JSON_TYPE_NUMBER: { + /* Yes. That's a random value. We only care about the string. */ + return json_object_new_double_s(299792458, object->data.number); + } + case VIR_JSON_TYPE_BOOLEAN: + return json_object_new_boolean(object->data.boolean); + + case VIR_JSON_TYPE_NULL: + default: + return NULL; + } + return NULL; +} + + +int +virJSONValueToBuffer(virJSONValue *object, + virBuffer *buf, + bool pretty) +{ + json_object *jobj = NULL; + const char *str; + size_t len; + int ret = -1; + int jsonflags = JSON_C_TO_STRING_NOSLASHESCAPE; + + VIR_DEBUG("object=%p", object); + + if (pretty) + jsonflags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED; + + jobj = virJSONValueToJsonC(object); + if (!jobj) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to convert virJSONValue to json-c data")); + goto cleanup; + } + + str = json_object_to_json_string_length(jobj, jsonflags, &len); + + virBufferAdd(buf, str, len); + if (pretty) + virBufferAddLit(buf, "\n"); + ret = 0; + + cleanup: + json_object_put(jobj); + return ret; +} + +#elif WITH_YAJL static int virJSONParserInsertValue(virJSONParser *parser, virJSONValue **value) -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:22 +0200, Ján Tomko wrote:
Write an alternative implementation of our virJSON functions, using json-c instead of yajl.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/util/virjson.c | 177 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 175 insertions(+), 2 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..7a22c54f03 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c
[...]
@@ -1389,8 +1391,179 @@ virJSONValueCopy(const virJSONValue *in) return out; }
Two lines.
+#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj)
Hmm, I wonder how much feasible is it to rewrite the helpers to avoid this conversion in the future.
+{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL;
-#if WITH_YAJL + switch (type) { + case json_type_null: + ret = virJSONValueNewNull(); + break; + case json_type_boolean: + ret = virJSONValueNewBoolean(json_object_get_boolean(jobj)); + break; + case json_type_double: + case json_type_int: { + ret = virJSONValueNewNumber(g_strdup(json_object_get_string(jobj))); + break; + } + case json_type_object: + ret = virJSONValueNewObject(); + {
This block-in-case style is very punk.
+ json_object_object_foreach(jobj, key, val) { + virJSONValue *cur = virJSONValueFromJsonC(val); + + if (virJSONValueObjectAppend(ret, key, &cur) < 0) { + g_free(ret); + return NULL; + } + } + } + break; + case json_type_array: { + size_t len; + size_t i; + + ret = virJSONValueNewArray(); + len = json_object_array_length(jobj); + + for (i = 0; i < len; i++) { + virJSONValue *cur = NULL; + json_object *val = NULL; + + val = json_object_array_get_idx(jobj, i); + + cur = virJSONValueFromJsonC(val); + + virJSONValueArrayAppend(ret, &cur); + } + break; + } + case json_type_string: + ret = virJSONValueNewString(g_strdup(json_object_get_string(jobj))); + break; + } + + VIR_DEBUG("ret=%p", ret);
I doubt this is useful. Either drop it or print at least the 'type' field.
+ return ret; +} + +virJSONValue *
Two lines.
+virJSONValueFromString(const char *jsonstring) +{ + json_object *jobj = NULL; + virJSONValue *ret = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; + + VIR_DEBUG("string=%s", jsonstring); + + tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags); + jobj = json_tokener_parse_ex(tok, jsonstring, strlen(jsonstring)); + jerr = json_tokener_get_error(tok); + if (jerr != json_tokener_success) { + virReportError(VIR_ERR_INTERNAL_ERROR, + "%s", json_tokener_error_desc(jerr)); + goto cleanup; + } + ret = virJSONValueFromJsonC(jobj); + + cleanup: + VIR_DEBUG("result=%p", ret);
So this effectively will always be a pointer except when the json_tokener_parse_ex returned error, but in that case we'd already report an error. Is it really needed?
+ json_object_put(jobj); + json_tokener_free(tok); + return ret; +} + +static json_object * +virJSONValueToJsonC(virJSONValue *object) +{ + json_object *ret = NULL; + size_t i; + + VIR_DEBUG("object=%p type=%d", object, object->type);
^^ this is imo more useful.
+ + switch (object->type) { + case VIR_JSON_TYPE_OBJECT: + // constant key?
c99 comment.
+ ret = json_object_new_object(); + for (i = 0; i < object->data.object.npairs; i++) { + json_object *child = virJSONValueToJsonC(object->data.object.pairs[i].value); + json_object_object_add(ret, object->data.object.pairs[i].key, child); + } + return ret; + case VIR_JSON_TYPE_ARRAY: + /* json_object_new_array_ext was introduced in json-c 0.16 */ +# if JSON_C_VERSION_NUM < ((0 << 16) | (16 << 8)) + ret = json_object_new_array(); +# else + ret = json_object_new_array_ext(object->data.array.nvalues); +# endif + for (i = 0; i < object->data.array.nvalues; i++) { + json_object_array_add(ret, + virJSONValueToJsonC(object->data.array.values[i])); + } + return ret; + + case VIR_JSON_TYPE_STRING: + return json_object_new_string(object->data.string); + + case VIR_JSON_TYPE_NUMBER: { + /* Yes. That's a random value. We only care about the string. */ + return json_object_new_double_s(299792458, object->data.number);
oof. Shouldn't we at least attempt to format the number into a double? I understand that you're using this to allow for the exact representation and that a cannary value might ease debugging but this looks a bit weird. At least add a comment explaining that it's a cannary and a hack so that json-c will use our representation.
+ } + case VIR_JSON_TYPE_BOOLEAN: + return json_object_new_boolean(object->data.boolean); + + case VIR_JSON_TYPE_NULL: + default: + return NULL; + } + return NULL; +} + + +int +virJSONValueToBuffer(virJSONValue *object, + virBuffer *buf, + bool pretty) +{ + json_object *jobj = NULL; + const char *str; + size_t len; + int ret = -1; + int jsonflags = JSON_C_TO_STRING_NOSLASHESCAPE; + + VIR_DEBUG("object=%p", object); + + if (pretty) + jsonflags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED; + + jobj = virJSONValueToJsonC(object); + if (!jobj) {
So here you check the return value of 'virJSONValueToJsonC' but none of the other calls in this function do that.
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("failed to convert virJSONValue to json-c data")); + goto cleanup; + } + + str = json_object_to_json_string_length(jobj, jsonflags, &len); + + virBufferAdd(buf, str, len); + if (pretty) + virBufferAddLit(buf, "\n"); + ret = 0; + + cleanup: + json_object_put(jobj); + return ret; +} +
Two lines.
+#elif WITH_YAJL
Looks good, but I want to understand the error reporting discrepancy I've pointed out above before giving r-b.

Now that we actually have some working code using json-c, install it in our CI to demonstrate that it works. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- ci/buildenv/almalinux-9.sh | 1 + ci/buildenv/alpine-319.sh | 1 + ci/buildenv/alpine-edge.sh | 1 + ci/buildenv/centos-stream-9.sh | 1 + ci/buildenv/debian-11-cross-aarch64.sh | 1 + ci/buildenv/debian-11-cross-armv6l.sh | 1 + ci/buildenv/debian-11-cross-armv7l.sh | 1 + ci/buildenv/debian-11-cross-i686.sh | 1 + ci/buildenv/debian-11-cross-mips64el.sh | 1 + ci/buildenv/debian-11-cross-mipsel.sh | 1 + ci/buildenv/debian-11-cross-ppc64le.sh | 1 + ci/buildenv/debian-11-cross-s390x.sh | 1 + ci/buildenv/debian-11.sh | 1 + ci/buildenv/debian-12-cross-aarch64.sh | 1 + ci/buildenv/debian-12-cross-armv6l.sh | 1 + ci/buildenv/debian-12-cross-armv7l.sh | 1 + ci/buildenv/debian-12-cross-i686.sh | 1 + ci/buildenv/debian-12-cross-mips64el.sh | 1 + ci/buildenv/debian-12-cross-mipsel.sh | 1 + ci/buildenv/debian-12-cross-ppc64le.sh | 1 + ci/buildenv/debian-12-cross-s390x.sh | 1 + ci/buildenv/debian-12.sh | 1 + ci/buildenv/debian-sid-cross-aarch64.sh | 1 + ci/buildenv/debian-sid-cross-armv6l.sh | 1 + ci/buildenv/debian-sid-cross-armv7l.sh | 1 + ci/buildenv/debian-sid-cross-i686.sh | 1 + ci/buildenv/debian-sid-cross-mips64el.sh | 1 + ci/buildenv/debian-sid-cross-ppc64le.sh | 1 + ci/buildenv/debian-sid-cross-s390x.sh | 1 + ci/buildenv/debian-sid.sh | 1 + ci/buildenv/fedora-39.sh | 1 + ci/buildenv/fedora-40.sh | 1 + ci/buildenv/fedora-rawhide.sh | 1 + ci/buildenv/opensuse-leap-15.sh | 1 + ci/buildenv/opensuse-tumbleweed.sh | 1 + ci/buildenv/ubuntu-2204.sh | 1 + ci/buildenv/ubuntu-2404.sh | 1 + ci/cirrus/freebsd-13.vars | 2 +- ci/cirrus/freebsd-14.vars | 2 +- ci/cirrus/macos-13.vars | 2 +- ci/cirrus/macos-14.vars | 2 +- ci/containers/almalinux-9.Dockerfile | 1 + ci/containers/alpine-319.Dockerfile | 1 + ci/containers/alpine-edge.Dockerfile | 1 + ci/containers/centos-stream-9.Dockerfile | 1 + ci/containers/debian-11-cross-aarch64.Dockerfile | 1 + ci/containers/debian-11-cross-armv6l.Dockerfile | 1 + ci/containers/debian-11-cross-armv7l.Dockerfile | 1 + ci/containers/debian-11-cross-i686.Dockerfile | 1 + ci/containers/debian-11-cross-mips64el.Dockerfile | 1 + ci/containers/debian-11-cross-mipsel.Dockerfile | 1 + ci/containers/debian-11-cross-ppc64le.Dockerfile | 1 + ci/containers/debian-11-cross-s390x.Dockerfile | 1 + ci/containers/debian-11.Dockerfile | 1 + ci/containers/debian-12-cross-aarch64.Dockerfile | 1 + ci/containers/debian-12-cross-armv6l.Dockerfile | 1 + ci/containers/debian-12-cross-armv7l.Dockerfile | 1 + ci/containers/debian-12-cross-i686.Dockerfile | 1 + ci/containers/debian-12-cross-mips64el.Dockerfile | 1 + ci/containers/debian-12-cross-mipsel.Dockerfile | 1 + ci/containers/debian-12-cross-ppc64le.Dockerfile | 1 + ci/containers/debian-12-cross-s390x.Dockerfile | 1 + ci/containers/debian-12.Dockerfile | 1 + ci/containers/debian-sid-cross-aarch64.Dockerfile | 1 + ci/containers/debian-sid-cross-armv6l.Dockerfile | 1 + ci/containers/debian-sid-cross-armv7l.Dockerfile | 1 + ci/containers/debian-sid-cross-i686.Dockerfile | 1 + ci/containers/debian-sid-cross-mips64el.Dockerfile | 1 + ci/containers/debian-sid-cross-ppc64le.Dockerfile | 1 + ci/containers/debian-sid-cross-s390x.Dockerfile | 1 + ci/containers/debian-sid.Dockerfile | 1 + ci/containers/fedora-39.Dockerfile | 1 + ci/containers/fedora-40.Dockerfile | 1 + ci/containers/fedora-rawhide.Dockerfile | 1 + ci/containers/opensuse-leap-15.Dockerfile | 1 + ci/containers/opensuse-tumbleweed.Dockerfile | 1 + ci/containers/ubuntu-2204.Dockerfile | 1 + ci/containers/ubuntu-2404.Dockerfile | 1 + ci/lcitool/projects/libvirt.yml | 1 + 79 files changed, 79 insertions(+), 4 deletions(-) diff --git a/ci/buildenv/almalinux-9.sh b/ci/buildenv/almalinux-9.sh index 5791a73d23..6ca05b4add 100644 --- a/ci/buildenv/almalinux-9.sh +++ b/ci/buildenv/almalinux-9.sh @@ -37,6 +37,7 @@ function install_buildenv() { iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/buildenv/alpine-319.sh b/ci/buildenv/alpine-319.sh index 43fcb38a46..fe8dcf8ab7 100644 --- a/ci/buildenv/alpine-319.sh +++ b/ci/buildenv/alpine-319.sh @@ -31,6 +31,7 @@ function install_buildenv() { grep \ iproute2 \ iptables \ + json-c-dev \ kmod \ libcap-ng-dev \ libnl3-dev \ diff --git a/ci/buildenv/alpine-edge.sh b/ci/buildenv/alpine-edge.sh index 43fcb38a46..fe8dcf8ab7 100644 --- a/ci/buildenv/alpine-edge.sh +++ b/ci/buildenv/alpine-edge.sh @@ -31,6 +31,7 @@ function install_buildenv() { grep \ iproute2 \ iptables \ + json-c-dev \ kmod \ libcap-ng-dev \ libnl3-dev \ diff --git a/ci/buildenv/centos-stream-9.sh b/ci/buildenv/centos-stream-9.sh index c23c60e026..ca5bce3eb9 100644 --- a/ci/buildenv/centos-stream-9.sh +++ b/ci/buildenv/centos-stream-9.sh @@ -38,6 +38,7 @@ function install_buildenv() { iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/buildenv/debian-11-cross-aarch64.sh b/ci/buildenv/debian-11-cross-aarch64.sh index 8540fb8d74..2d9ad9064d 100644 --- a/ci/buildenv/debian-11-cross-aarch64.sh +++ b/ci/buildenv/debian-11-cross-aarch64.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:arm64 \ libgnutls28-dev:arm64 \ libiscsi-dev:arm64 \ + libjson-c-dev:arm64 \ libnl-3-dev:arm64 \ libnl-route-3-dev:arm64 \ libnuma-dev:arm64 \ diff --git a/ci/buildenv/debian-11-cross-armv6l.sh b/ci/buildenv/debian-11-cross-armv6l.sh index 131a7019c0..2be50a66c9 100644 --- a/ci/buildenv/debian-11-cross-armv6l.sh +++ b/ci/buildenv/debian-11-cross-armv6l.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:armel \ libgnutls28-dev:armel \ libiscsi-dev:armel \ + libjson-c-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ libnuma-dev:armel \ diff --git a/ci/buildenv/debian-11-cross-armv7l.sh b/ci/buildenv/debian-11-cross-armv7l.sh index ba78ffcfac..6d6ef91868 100644 --- a/ci/buildenv/debian-11-cross-armv7l.sh +++ b/ci/buildenv/debian-11-cross-armv7l.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:armhf \ libgnutls28-dev:armhf \ libiscsi-dev:armhf \ + libjson-c-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ libnuma-dev:armhf \ diff --git a/ci/buildenv/debian-11-cross-i686.sh b/ci/buildenv/debian-11-cross-i686.sh index 104eb20805..b8bd49e3a8 100644 --- a/ci/buildenv/debian-11-cross-i686.sh +++ b/ci/buildenv/debian-11-cross-i686.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:i386 \ libgnutls28-dev:i386 \ libiscsi-dev:i386 \ + libjson-c-dev:i386 \ libnl-3-dev:i386 \ libnl-route-3-dev:i386 \ libnuma-dev:i386 \ diff --git a/ci/buildenv/debian-11-cross-mips64el.sh b/ci/buildenv/debian-11-cross-mips64el.sh index 7b1830453c..3d5b75139c 100644 --- a/ci/buildenv/debian-11-cross-mips64el.sh +++ b/ci/buildenv/debian-11-cross-mips64el.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:mips64el \ libgnutls28-dev:mips64el \ libiscsi-dev:mips64el \ + libjson-c-dev:mips64el \ libnl-3-dev:mips64el \ libnl-route-3-dev:mips64el \ libnuma-dev:mips64el \ diff --git a/ci/buildenv/debian-11-cross-mipsel.sh b/ci/buildenv/debian-11-cross-mipsel.sh index eef5cdbfab..20a97c165e 100644 --- a/ci/buildenv/debian-11-cross-mipsel.sh +++ b/ci/buildenv/debian-11-cross-mipsel.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:mipsel \ libgnutls28-dev:mipsel \ libiscsi-dev:mipsel \ + libjson-c-dev:mipsel \ libnl-3-dev:mipsel \ libnl-route-3-dev:mipsel \ libnuma-dev:mipsel \ diff --git a/ci/buildenv/debian-11-cross-ppc64le.sh b/ci/buildenv/debian-11-cross-ppc64le.sh index f2c2f60623..2b5ebf360d 100644 --- a/ci/buildenv/debian-11-cross-ppc64le.sh +++ b/ci/buildenv/debian-11-cross-ppc64le.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:ppc64el \ libgnutls28-dev:ppc64el \ libiscsi-dev:ppc64el \ + libjson-c-dev:ppc64el \ libnl-3-dev:ppc64el \ libnl-route-3-dev:ppc64el \ libnuma-dev:ppc64el \ diff --git a/ci/buildenv/debian-11-cross-s390x.sh b/ci/buildenv/debian-11-cross-s390x.sh index 519d9c8b31..1391685e46 100644 --- a/ci/buildenv/debian-11-cross-s390x.sh +++ b/ci/buildenv/debian-11-cross-s390x.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglusterfs-dev:s390x \ libgnutls28-dev:s390x \ libiscsi-dev:s390x \ + libjson-c-dev:s390x \ libnl-3-dev:s390x \ libnl-route-3-dev:s390x \ libnuma-dev:s390x \ diff --git a/ci/buildenv/debian-11.sh b/ci/buildenv/debian-11.sh index 5986682af8..e56ea3b3ec 100644 --- a/ci/buildenv/debian-11.sh +++ b/ci/buildenv/debian-11.sh @@ -44,6 +44,7 @@ function install_buildenv() { libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnetcf-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/buildenv/debian-12-cross-aarch64.sh b/ci/buildenv/debian-12-cross-aarch64.sh index 5fc7e8a801..4f7285e171 100644 --- a/ci/buildenv/debian-12-cross-aarch64.sh +++ b/ci/buildenv/debian-12-cross-aarch64.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:arm64 \ libgnutls28-dev:arm64 \ libiscsi-dev:arm64 \ + libjson-c-dev:arm64 \ libnl-3-dev:arm64 \ libnl-route-3-dev:arm64 \ libnuma-dev:arm64 \ diff --git a/ci/buildenv/debian-12-cross-armv6l.sh b/ci/buildenv/debian-12-cross-armv6l.sh index 24d7d80380..6d98d1deff 100644 --- a/ci/buildenv/debian-12-cross-armv6l.sh +++ b/ci/buildenv/debian-12-cross-armv6l.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:armel \ libgnutls28-dev:armel \ libiscsi-dev:armel \ + libjson-c-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ libnuma-dev:armel \ diff --git a/ci/buildenv/debian-12-cross-armv7l.sh b/ci/buildenv/debian-12-cross-armv7l.sh index 35738e6bb2..39d064b659 100644 --- a/ci/buildenv/debian-12-cross-armv7l.sh +++ b/ci/buildenv/debian-12-cross-armv7l.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:armhf \ libgnutls28-dev:armhf \ libiscsi-dev:armhf \ + libjson-c-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ libnuma-dev:armhf \ diff --git a/ci/buildenv/debian-12-cross-i686.sh b/ci/buildenv/debian-12-cross-i686.sh index dce90645c0..aa91d6e08a 100644 --- a/ci/buildenv/debian-12-cross-i686.sh +++ b/ci/buildenv/debian-12-cross-i686.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:i386 \ libgnutls28-dev:i386 \ libiscsi-dev:i386 \ + libjson-c-dev:i386 \ libnl-3-dev:i386 \ libnl-route-3-dev:i386 \ libnuma-dev:i386 \ diff --git a/ci/buildenv/debian-12-cross-mips64el.sh b/ci/buildenv/debian-12-cross-mips64el.sh index 6d3e43aeb0..e3b92bf9db 100644 --- a/ci/buildenv/debian-12-cross-mips64el.sh +++ b/ci/buildenv/debian-12-cross-mips64el.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:mips64el \ libgnutls28-dev:mips64el \ libiscsi-dev:mips64el \ + libjson-c-dev:mips64el \ libnl-3-dev:mips64el \ libnl-route-3-dev:mips64el \ libnuma-dev:mips64el \ diff --git a/ci/buildenv/debian-12-cross-mipsel.sh b/ci/buildenv/debian-12-cross-mipsel.sh index b3a9ba1f40..7c5de342a4 100644 --- a/ci/buildenv/debian-12-cross-mipsel.sh +++ b/ci/buildenv/debian-12-cross-mipsel.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:mipsel \ libgnutls28-dev:mipsel \ libiscsi-dev:mipsel \ + libjson-c-dev:mipsel \ libnl-3-dev:mipsel \ libnl-route-3-dev:mipsel \ libnuma-dev:mipsel \ diff --git a/ci/buildenv/debian-12-cross-ppc64le.sh b/ci/buildenv/debian-12-cross-ppc64le.sh index 1cda4f7928..05f2a2bd54 100644 --- a/ci/buildenv/debian-12-cross-ppc64le.sh +++ b/ci/buildenv/debian-12-cross-ppc64le.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:ppc64el \ libgnutls28-dev:ppc64el \ libiscsi-dev:ppc64el \ + libjson-c-dev:ppc64el \ libnl-3-dev:ppc64el \ libnl-route-3-dev:ppc64el \ libnuma-dev:ppc64el \ diff --git a/ci/buildenv/debian-12-cross-s390x.sh b/ci/buildenv/debian-12-cross-s390x.sh index f0cbfad5a4..b092d59b9d 100644 --- a/ci/buildenv/debian-12-cross-s390x.sh +++ b/ci/buildenv/debian-12-cross-s390x.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:s390x \ libgnutls28-dev:s390x \ libiscsi-dev:s390x \ + libjson-c-dev:s390x \ libnl-3-dev:s390x \ libnl-route-3-dev:s390x \ libnuma-dev:s390x \ diff --git a/ci/buildenv/debian-12.sh b/ci/buildenv/debian-12.sh index 5f19ba7526..01777c2165 100644 --- a/ci/buildenv/debian-12.sh +++ b/ci/buildenv/debian-12.sh @@ -44,6 +44,7 @@ function install_buildenv() { libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/buildenv/debian-sid-cross-aarch64.sh b/ci/buildenv/debian-sid-cross-aarch64.sh index 5fc7e8a801..4f7285e171 100644 --- a/ci/buildenv/debian-sid-cross-aarch64.sh +++ b/ci/buildenv/debian-sid-cross-aarch64.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:arm64 \ libgnutls28-dev:arm64 \ libiscsi-dev:arm64 \ + libjson-c-dev:arm64 \ libnl-3-dev:arm64 \ libnl-route-3-dev:arm64 \ libnuma-dev:arm64 \ diff --git a/ci/buildenv/debian-sid-cross-armv6l.sh b/ci/buildenv/debian-sid-cross-armv6l.sh index 46e374ea88..c5ced00879 100644 --- a/ci/buildenv/debian-sid-cross-armv6l.sh +++ b/ci/buildenv/debian-sid-cross-armv6l.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglib2.0-dev:armel \ libgnutls28-dev:armel \ libiscsi-dev:armel \ + libjson-c-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ libnuma-dev:armel \ diff --git a/ci/buildenv/debian-sid-cross-armv7l.sh b/ci/buildenv/debian-sid-cross-armv7l.sh index c8bb1b9539..38c3dffe1a 100644 --- a/ci/buildenv/debian-sid-cross-armv7l.sh +++ b/ci/buildenv/debian-sid-cross-armv7l.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglib2.0-dev:armhf \ libgnutls28-dev:armhf \ libiscsi-dev:armhf \ + libjson-c-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ libnuma-dev:armhf \ diff --git a/ci/buildenv/debian-sid-cross-i686.sh b/ci/buildenv/debian-sid-cross-i686.sh index e74b2cee73..59694cca46 100644 --- a/ci/buildenv/debian-sid-cross-i686.sh +++ b/ci/buildenv/debian-sid-cross-i686.sh @@ -70,6 +70,7 @@ function install_buildenv() { libglib2.0-dev:i386 \ libgnutls28-dev:i386 \ libiscsi-dev:i386 \ + libjson-c-dev:i386 \ libnl-3-dev:i386 \ libnl-route-3-dev:i386 \ libnuma-dev:i386 \ diff --git a/ci/buildenv/debian-sid-cross-mips64el.sh b/ci/buildenv/debian-sid-cross-mips64el.sh index 6d3e43aeb0..e3b92bf9db 100644 --- a/ci/buildenv/debian-sid-cross-mips64el.sh +++ b/ci/buildenv/debian-sid-cross-mips64el.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:mips64el \ libgnutls28-dev:mips64el \ libiscsi-dev:mips64el \ + libjson-c-dev:mips64el \ libnl-3-dev:mips64el \ libnl-route-3-dev:mips64el \ libnuma-dev:mips64el \ diff --git a/ci/buildenv/debian-sid-cross-ppc64le.sh b/ci/buildenv/debian-sid-cross-ppc64le.sh index 1cda4f7928..05f2a2bd54 100644 --- a/ci/buildenv/debian-sid-cross-ppc64le.sh +++ b/ci/buildenv/debian-sid-cross-ppc64le.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:ppc64el \ libgnutls28-dev:ppc64el \ libiscsi-dev:ppc64el \ + libjson-c-dev:ppc64el \ libnl-3-dev:ppc64el \ libnl-route-3-dev:ppc64el \ libnuma-dev:ppc64el \ diff --git a/ci/buildenv/debian-sid-cross-s390x.sh b/ci/buildenv/debian-sid-cross-s390x.sh index f0cbfad5a4..b092d59b9d 100644 --- a/ci/buildenv/debian-sid-cross-s390x.sh +++ b/ci/buildenv/debian-sid-cross-s390x.sh @@ -71,6 +71,7 @@ function install_buildenv() { libglusterfs-dev:s390x \ libgnutls28-dev:s390x \ libiscsi-dev:s390x \ + libjson-c-dev:s390x \ libnl-3-dev:s390x \ libnl-route-3-dev:s390x \ libnuma-dev:s390x \ diff --git a/ci/buildenv/debian-sid.sh b/ci/buildenv/debian-sid.sh index 5f19ba7526..01777c2165 100644 --- a/ci/buildenv/debian-sid.sh +++ b/ci/buildenv/debian-sid.sh @@ -44,6 +44,7 @@ function install_buildenv() { libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/buildenv/fedora-39.sh b/ci/buildenv/fedora-39.sh index db9d88eff4..06ae3bb62d 100644 --- a/ci/buildenv/fedora-39.sh +++ b/ci/buildenv/fedora-39.sh @@ -37,6 +37,7 @@ function install_buildenv() { iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/buildenv/fedora-40.sh b/ci/buildenv/fedora-40.sh index db9d88eff4..06ae3bb62d 100644 --- a/ci/buildenv/fedora-40.sh +++ b/ci/buildenv/fedora-40.sh @@ -37,6 +37,7 @@ function install_buildenv() { iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/buildenv/fedora-rawhide.sh b/ci/buildenv/fedora-rawhide.sh index f89a87ad63..aec2d87b53 100644 --- a/ci/buildenv/fedora-rawhide.sh +++ b/ci/buildenv/fedora-rawhide.sh @@ -38,6 +38,7 @@ function install_buildenv() { iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/buildenv/opensuse-leap-15.sh b/ci/buildenv/opensuse-leap-15.sh index a59af136ca..d462e6cdce 100644 --- a/ci/buildenv/opensuse-leap-15.sh +++ b/ci/buildenv/opensuse-leap-15.sh @@ -43,6 +43,7 @@ function install_buildenv() { libcurl-devel \ libgnutls-devel \ libiscsi-devel \ + libjson-c-devel \ libnbd-devel \ libnl3-devel \ libnuma-devel \ diff --git a/ci/buildenv/opensuse-tumbleweed.sh b/ci/buildenv/opensuse-tumbleweed.sh index ac566d349f..2233699719 100644 --- a/ci/buildenv/opensuse-tumbleweed.sh +++ b/ci/buildenv/opensuse-tumbleweed.sh @@ -43,6 +43,7 @@ function install_buildenv() { libcurl-devel \ libgnutls-devel \ libiscsi-devel \ + libjson-c-devel \ libnbd-devel \ libnl3-devel \ libnuma-devel \ diff --git a/ci/buildenv/ubuntu-2204.sh b/ci/buildenv/ubuntu-2204.sh index c71a0b5f47..e747a6f8c2 100644 --- a/ci/buildenv/ubuntu-2204.sh +++ b/ci/buildenv/ubuntu-2204.sh @@ -44,6 +44,7 @@ function install_buildenv() { libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/buildenv/ubuntu-2404.sh b/ci/buildenv/ubuntu-2404.sh index 3eacaa6cce..c26a80d06f 100644 --- a/ci/buildenv/ubuntu-2404.sh +++ b/ci/buildenv/ubuntu-2404.sh @@ -44,6 +44,7 @@ function install_buildenv() { libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/cirrus/freebsd-13.vars b/ci/cirrus/freebsd-13.vars index f24b921300..bf82ac5176 100644 --- a/ci/cirrus/freebsd-13.vars +++ b/ci/cirrus/freebsd-13.vars @@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline yajl' +PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline yajl' PYPI_PKGS='' PYTHON='/usr/local/bin/python3' diff --git a/ci/cirrus/freebsd-14.vars b/ci/cirrus/freebsd-14.vars index f24b921300..bf82ac5176 100644 --- a/ci/cirrus/freebsd-14.vars +++ b/ci/cirrus/freebsd-14.vars @@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline yajl' +PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline yajl' PYPI_PKGS='' PYTHON='/usr/local/bin/python3' diff --git a/ci/cirrus/macos-13.vars b/ci/cirrus/macos-13.vars index ca4e55887c..9860033931 100644 --- a/ci/cirrus/macos-13.vars +++ b/ci/cirrus/macos-13.vars @@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake' NINJA='/opt/homebrew/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/opt/homebrew/bin/pip3' -PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline yajl' +PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep json-c libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline yajl' PYPI_PKGS='pytest' PYTHON='/opt/homebrew/bin/python3' diff --git a/ci/cirrus/macos-14.vars b/ci/cirrus/macos-14.vars index ca4e55887c..9860033931 100644 --- a/ci/cirrus/macos-14.vars +++ b/ci/cirrus/macos-14.vars @@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake' NINJA='/opt/homebrew/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/opt/homebrew/bin/pip3' -PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline yajl' +PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep json-c libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline yajl' PYPI_PKGS='pytest' PYTHON='/opt/homebrew/bin/python3' diff --git a/ci/containers/almalinux-9.Dockerfile b/ci/containers/almalinux-9.Dockerfile index 27ac990b22..0f54cb3224 100644 --- a/ci/containers/almalinux-9.Dockerfile +++ b/ci/containers/almalinux-9.Dockerfile @@ -38,6 +38,7 @@ RUN dnf update -y && \ iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/containers/alpine-319.Dockerfile b/ci/containers/alpine-319.Dockerfile index 2455184a87..cdd9845a19 100644 --- a/ci/containers/alpine-319.Dockerfile +++ b/ci/containers/alpine-319.Dockerfile @@ -32,6 +32,7 @@ RUN apk update && \ grep \ iproute2 \ iptables \ + json-c-dev \ kmod \ libcap-ng-dev \ libnl3-dev \ diff --git a/ci/containers/alpine-edge.Dockerfile b/ci/containers/alpine-edge.Dockerfile index b28c96692c..4790d9ae8a 100644 --- a/ci/containers/alpine-edge.Dockerfile +++ b/ci/containers/alpine-edge.Dockerfile @@ -32,6 +32,7 @@ RUN apk update && \ grep \ iproute2 \ iptables \ + json-c-dev \ kmod \ libcap-ng-dev \ libnl3-dev \ diff --git a/ci/containers/centos-stream-9.Dockerfile b/ci/containers/centos-stream-9.Dockerfile index 93549eefad..d83ca27b93 100644 --- a/ci/containers/centos-stream-9.Dockerfile +++ b/ci/containers/centos-stream-9.Dockerfile @@ -39,6 +39,7 @@ RUN dnf distro-sync -y && \ iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/containers/debian-11-cross-aarch64.Dockerfile b/ci/containers/debian-11-cross-aarch64.Dockerfile index 1cb573821f..7a7d22b766 100644 --- a/ci/containers/debian-11-cross-aarch64.Dockerfile +++ b/ci/containers/debian-11-cross-aarch64.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:arm64 \ libgnutls28-dev:arm64 \ libiscsi-dev:arm64 \ + libjson-c-dev:arm64 \ libnl-3-dev:arm64 \ libnl-route-3-dev:arm64 \ libnuma-dev:arm64 \ diff --git a/ci/containers/debian-11-cross-armv6l.Dockerfile b/ci/containers/debian-11-cross-armv6l.Dockerfile index 6989546ebf..08737bb216 100644 --- a/ci/containers/debian-11-cross-armv6l.Dockerfile +++ b/ci/containers/debian-11-cross-armv6l.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:armel \ libgnutls28-dev:armel \ libiscsi-dev:armel \ + libjson-c-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ libnuma-dev:armel \ diff --git a/ci/containers/debian-11-cross-armv7l.Dockerfile b/ci/containers/debian-11-cross-armv7l.Dockerfile index fcd6a6383b..d8bb30d4a1 100644 --- a/ci/containers/debian-11-cross-armv7l.Dockerfile +++ b/ci/containers/debian-11-cross-armv7l.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:armhf \ libgnutls28-dev:armhf \ libiscsi-dev:armhf \ + libjson-c-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ libnuma-dev:armhf \ diff --git a/ci/containers/debian-11-cross-i686.Dockerfile b/ci/containers/debian-11-cross-i686.Dockerfile index 8d79934a52..c37a7d2bfa 100644 --- a/ci/containers/debian-11-cross-i686.Dockerfile +++ b/ci/containers/debian-11-cross-i686.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:i386 \ libgnutls28-dev:i386 \ libiscsi-dev:i386 \ + libjson-c-dev:i386 \ libnl-3-dev:i386 \ libnl-route-3-dev:i386 \ libnuma-dev:i386 \ diff --git a/ci/containers/debian-11-cross-mips64el.Dockerfile b/ci/containers/debian-11-cross-mips64el.Dockerfile index d80f741311..27556d7e07 100644 --- a/ci/containers/debian-11-cross-mips64el.Dockerfile +++ b/ci/containers/debian-11-cross-mips64el.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:mips64el \ libgnutls28-dev:mips64el \ libiscsi-dev:mips64el \ + libjson-c-dev:mips64el \ libnl-3-dev:mips64el \ libnl-route-3-dev:mips64el \ libnuma-dev:mips64el \ diff --git a/ci/containers/debian-11-cross-mipsel.Dockerfile b/ci/containers/debian-11-cross-mipsel.Dockerfile index dc674150f5..be0e9e0188 100644 --- a/ci/containers/debian-11-cross-mipsel.Dockerfile +++ b/ci/containers/debian-11-cross-mipsel.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:mipsel \ libgnutls28-dev:mipsel \ libiscsi-dev:mipsel \ + libjson-c-dev:mipsel \ libnl-3-dev:mipsel \ libnl-route-3-dev:mipsel \ libnuma-dev:mipsel \ diff --git a/ci/containers/debian-11-cross-ppc64le.Dockerfile b/ci/containers/debian-11-cross-ppc64le.Dockerfile index fc3a9ee157..cfbef7dcbc 100644 --- a/ci/containers/debian-11-cross-ppc64le.Dockerfile +++ b/ci/containers/debian-11-cross-ppc64le.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:ppc64el \ libgnutls28-dev:ppc64el \ libiscsi-dev:ppc64el \ + libjson-c-dev:ppc64el \ libnl-3-dev:ppc64el \ libnl-route-3-dev:ppc64el \ libnuma-dev:ppc64el \ diff --git a/ci/containers/debian-11-cross-s390x.Dockerfile b/ci/containers/debian-11-cross-s390x.Dockerfile index 336694b2d3..1b7cee0572 100644 --- a/ci/containers/debian-11-cross-s390x.Dockerfile +++ b/ci/containers/debian-11-cross-s390x.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:s390x \ libgnutls28-dev:s390x \ libiscsi-dev:s390x \ + libjson-c-dev:s390x \ libnl-3-dev:s390x \ libnl-route-3-dev:s390x \ libnuma-dev:s390x \ diff --git a/ci/containers/debian-11.Dockerfile b/ci/containers/debian-11.Dockerfile index 6f08eb7448..da72d538c0 100644 --- a/ci/containers/debian-11.Dockerfile +++ b/ci/containers/debian-11.Dockerfile @@ -46,6 +46,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnetcf-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/containers/debian-12-cross-aarch64.Dockerfile b/ci/containers/debian-12-cross-aarch64.Dockerfile index cc26cc2d11..1504ba0b72 100644 --- a/ci/containers/debian-12-cross-aarch64.Dockerfile +++ b/ci/containers/debian-12-cross-aarch64.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:arm64 \ libgnutls28-dev:arm64 \ libiscsi-dev:arm64 \ + libjson-c-dev:arm64 \ libnl-3-dev:arm64 \ libnl-route-3-dev:arm64 \ libnuma-dev:arm64 \ diff --git a/ci/containers/debian-12-cross-armv6l.Dockerfile b/ci/containers/debian-12-cross-armv6l.Dockerfile index 28235d9ba1..ce2c71d466 100644 --- a/ci/containers/debian-12-cross-armv6l.Dockerfile +++ b/ci/containers/debian-12-cross-armv6l.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:armel \ libgnutls28-dev:armel \ libiscsi-dev:armel \ + libjson-c-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ libnuma-dev:armel \ diff --git a/ci/containers/debian-12-cross-armv7l.Dockerfile b/ci/containers/debian-12-cross-armv7l.Dockerfile index 56fbb73ebd..410f4fe15d 100644 --- a/ci/containers/debian-12-cross-armv7l.Dockerfile +++ b/ci/containers/debian-12-cross-armv7l.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:armhf \ libgnutls28-dev:armhf \ libiscsi-dev:armhf \ + libjson-c-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ libnuma-dev:armhf \ diff --git a/ci/containers/debian-12-cross-i686.Dockerfile b/ci/containers/debian-12-cross-i686.Dockerfile index 4601cd297f..4ae974eb16 100644 --- a/ci/containers/debian-12-cross-i686.Dockerfile +++ b/ci/containers/debian-12-cross-i686.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:i386 \ libgnutls28-dev:i386 \ libiscsi-dev:i386 \ + libjson-c-dev:i386 \ libnl-3-dev:i386 \ libnl-route-3-dev:i386 \ libnuma-dev:i386 \ diff --git a/ci/containers/debian-12-cross-mips64el.Dockerfile b/ci/containers/debian-12-cross-mips64el.Dockerfile index 3d3c0615fa..9664b30c14 100644 --- a/ci/containers/debian-12-cross-mips64el.Dockerfile +++ b/ci/containers/debian-12-cross-mips64el.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:mips64el \ libgnutls28-dev:mips64el \ libiscsi-dev:mips64el \ + libjson-c-dev:mips64el \ libnl-3-dev:mips64el \ libnl-route-3-dev:mips64el \ libnuma-dev:mips64el \ diff --git a/ci/containers/debian-12-cross-mipsel.Dockerfile b/ci/containers/debian-12-cross-mipsel.Dockerfile index a1e1167f56..4692d1ce8c 100644 --- a/ci/containers/debian-12-cross-mipsel.Dockerfile +++ b/ci/containers/debian-12-cross-mipsel.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:mipsel \ libgnutls28-dev:mipsel \ libiscsi-dev:mipsel \ + libjson-c-dev:mipsel \ libnl-3-dev:mipsel \ libnl-route-3-dev:mipsel \ libnuma-dev:mipsel \ diff --git a/ci/containers/debian-12-cross-ppc64le.Dockerfile b/ci/containers/debian-12-cross-ppc64le.Dockerfile index 836b1c2ec5..17beefaea6 100644 --- a/ci/containers/debian-12-cross-ppc64le.Dockerfile +++ b/ci/containers/debian-12-cross-ppc64le.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:ppc64el \ libgnutls28-dev:ppc64el \ libiscsi-dev:ppc64el \ + libjson-c-dev:ppc64el \ libnl-3-dev:ppc64el \ libnl-route-3-dev:ppc64el \ libnuma-dev:ppc64el \ diff --git a/ci/containers/debian-12-cross-s390x.Dockerfile b/ci/containers/debian-12-cross-s390x.Dockerfile index 000e357b97..88006f9a74 100644 --- a/ci/containers/debian-12-cross-s390x.Dockerfile +++ b/ci/containers/debian-12-cross-s390x.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:s390x \ libgnutls28-dev:s390x \ libiscsi-dev:s390x \ + libjson-c-dev:s390x \ libnl-3-dev:s390x \ libnl-route-3-dev:s390x \ libnuma-dev:s390x \ diff --git a/ci/containers/debian-12.Dockerfile b/ci/containers/debian-12.Dockerfile index bacfd9ada4..8b34ea98fb 100644 --- a/ci/containers/debian-12.Dockerfile +++ b/ci/containers/debian-12.Dockerfile @@ -46,6 +46,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/containers/debian-sid-cross-aarch64.Dockerfile b/ci/containers/debian-sid-cross-aarch64.Dockerfile index 48335d5221..cbbea29d12 100644 --- a/ci/containers/debian-sid-cross-aarch64.Dockerfile +++ b/ci/containers/debian-sid-cross-aarch64.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:arm64 \ libgnutls28-dev:arm64 \ libiscsi-dev:arm64 \ + libjson-c-dev:arm64 \ libnl-3-dev:arm64 \ libnl-route-3-dev:arm64 \ libnuma-dev:arm64 \ diff --git a/ci/containers/debian-sid-cross-armv6l.Dockerfile b/ci/containers/debian-sid-cross-armv6l.Dockerfile index b9cdd95548..94d130baf8 100644 --- a/ci/containers/debian-sid-cross-armv6l.Dockerfile +++ b/ci/containers/debian-sid-cross-armv6l.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglib2.0-dev:armel \ libgnutls28-dev:armel \ libiscsi-dev:armel \ + libjson-c-dev:armel \ libnl-3-dev:armel \ libnl-route-3-dev:armel \ libnuma-dev:armel \ diff --git a/ci/containers/debian-sid-cross-armv7l.Dockerfile b/ci/containers/debian-sid-cross-armv7l.Dockerfile index 4787aea1cd..b1251ffec3 100644 --- a/ci/containers/debian-sid-cross-armv7l.Dockerfile +++ b/ci/containers/debian-sid-cross-armv7l.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglib2.0-dev:armhf \ libgnutls28-dev:armhf \ libiscsi-dev:armhf \ + libjson-c-dev:armhf \ libnl-3-dev:armhf \ libnl-route-3-dev:armhf \ libnuma-dev:armhf \ diff --git a/ci/containers/debian-sid-cross-i686.Dockerfile b/ci/containers/debian-sid-cross-i686.Dockerfile index 66d84474dc..30b1c268a2 100644 --- a/ci/containers/debian-sid-cross-i686.Dockerfile +++ b/ci/containers/debian-sid-cross-i686.Dockerfile @@ -81,6 +81,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglib2.0-dev:i386 \ libgnutls28-dev:i386 \ libiscsi-dev:i386 \ + libjson-c-dev:i386 \ libnl-3-dev:i386 \ libnl-route-3-dev:i386 \ libnuma-dev:i386 \ diff --git a/ci/containers/debian-sid-cross-mips64el.Dockerfile b/ci/containers/debian-sid-cross-mips64el.Dockerfile index 4e325bf076..216dbacfa1 100644 --- a/ci/containers/debian-sid-cross-mips64el.Dockerfile +++ b/ci/containers/debian-sid-cross-mips64el.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:mips64el \ libgnutls28-dev:mips64el \ libiscsi-dev:mips64el \ + libjson-c-dev:mips64el \ libnl-3-dev:mips64el \ libnl-route-3-dev:mips64el \ libnuma-dev:mips64el \ diff --git a/ci/containers/debian-sid-cross-ppc64le.Dockerfile b/ci/containers/debian-sid-cross-ppc64le.Dockerfile index 8a53dd73bd..2e93762cbf 100644 --- a/ci/containers/debian-sid-cross-ppc64le.Dockerfile +++ b/ci/containers/debian-sid-cross-ppc64le.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:ppc64el \ libgnutls28-dev:ppc64el \ libiscsi-dev:ppc64el \ + libjson-c-dev:ppc64el \ libnl-3-dev:ppc64el \ libnl-route-3-dev:ppc64el \ libnuma-dev:ppc64el \ diff --git a/ci/containers/debian-sid-cross-s390x.Dockerfile b/ci/containers/debian-sid-cross-s390x.Dockerfile index f9c91d56de..e106382a21 100644 --- a/ci/containers/debian-sid-cross-s390x.Dockerfile +++ b/ci/containers/debian-sid-cross-s390x.Dockerfile @@ -82,6 +82,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev:s390x \ libgnutls28-dev:s390x \ libiscsi-dev:s390x \ + libjson-c-dev:s390x \ libnl-3-dev:s390x \ libnl-route-3-dev:s390x \ libnuma-dev:s390x \ diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile index 0084e418d3..1bf2fa5a00 100644 --- a/ci/containers/debian-sid.Dockerfile +++ b/ci/containers/debian-sid.Dockerfile @@ -46,6 +46,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/containers/fedora-39.Dockerfile b/ci/containers/fedora-39.Dockerfile index 91135bf15f..6a528ba71b 100644 --- a/ci/containers/fedora-39.Dockerfile +++ b/ci/containers/fedora-39.Dockerfile @@ -48,6 +48,7 @@ exec "$@"\n' > /usr/bin/nosync && \ iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/containers/fedora-40.Dockerfile b/ci/containers/fedora-40.Dockerfile index 97e1858473..4f22956c3c 100644 --- a/ci/containers/fedora-40.Dockerfile +++ b/ci/containers/fedora-40.Dockerfile @@ -48,6 +48,7 @@ exec "$@"\n' > /usr/bin/nosync && \ iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/containers/fedora-rawhide.Dockerfile b/ci/containers/fedora-rawhide.Dockerfile index 6f06843985..5d1cc5961c 100644 --- a/ci/containers/fedora-rawhide.Dockerfile +++ b/ci/containers/fedora-rawhide.Dockerfile @@ -49,6 +49,7 @@ exec "$@"\n' > /usr/bin/nosync && \ iproute-tc \ iptables \ iscsi-initiator-utils \ + json-c-devel \ kmod \ libacl-devel \ libattr-devel \ diff --git a/ci/containers/opensuse-leap-15.Dockerfile b/ci/containers/opensuse-leap-15.Dockerfile index b152528378..614af86f2c 100644 --- a/ci/containers/opensuse-leap-15.Dockerfile +++ b/ci/containers/opensuse-leap-15.Dockerfile @@ -44,6 +44,7 @@ RUN zypper update -y && \ libcurl-devel \ libgnutls-devel \ libiscsi-devel \ + libjson-c-devel \ libnbd-devel \ libnl3-devel \ libnuma-devel \ diff --git a/ci/containers/opensuse-tumbleweed.Dockerfile b/ci/containers/opensuse-tumbleweed.Dockerfile index 2b7cdb4af5..bf47571338 100644 --- a/ci/containers/opensuse-tumbleweed.Dockerfile +++ b/ci/containers/opensuse-tumbleweed.Dockerfile @@ -44,6 +44,7 @@ RUN zypper dist-upgrade -y && \ libcurl-devel \ libgnutls-devel \ libiscsi-devel \ + libjson-c-devel \ libnbd-devel \ libnl3-devel \ libnuma-devel \ diff --git a/ci/containers/ubuntu-2204.Dockerfile b/ci/containers/ubuntu-2204.Dockerfile index 5e8829bc2b..5de2ac6801 100644 --- a/ci/containers/ubuntu-2204.Dockerfile +++ b/ci/containers/ubuntu-2204.Dockerfile @@ -46,6 +46,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/containers/ubuntu-2404.Dockerfile b/ci/containers/ubuntu-2404.Dockerfile index 4a6c63b5a4..86bab63fc9 100644 --- a/ci/containers/ubuntu-2404.Dockerfile +++ b/ci/containers/ubuntu-2404.Dockerfile @@ -46,6 +46,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libglusterfs-dev \ libgnutls28-dev \ libiscsi-dev \ + libjson-c-dev \ libnbd-dev \ libnl-3-dev \ libnl-route-3-dev \ diff --git a/ci/lcitool/projects/libvirt.yml b/ci/lcitool/projects/libvirt.yml index 5e0bd66958..a02fe9b8bf 100644 --- a/ci/lcitool/projects/libvirt.yml +++ b/ci/lcitool/projects/libvirt.yml @@ -30,6 +30,7 @@ packages: - ip - iptables - iscsiadm + - json-c - libacl - libattr - libaudit -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:23 +0200, Ján Tomko wrote:
Now that we actually have some working code using json-c, install it in our CI to demonstrate that it works.
Signed-off-by: Ján Tomko <jtomko@redhat.com> ---
As this is a ci refresh I'd refrain from saying that this demonstrates the usage. The usage should be demonstrated by enabling it explicitly as I've requested explicit disabling at least in the .spec file. Regardless: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tools/nss/meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/nss/meson.build b/tools/nss/meson.build index 85e2838fb7..1cae93ac67 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -28,6 +28,7 @@ nss_libvirt_impl = static_library( '-DLIBVIRT_NSS' ], dependencies: [ + json_c_dep, tools_dep, yajl_dep, ], @@ -44,6 +45,7 @@ nss_libvirt_guest_impl = static_library( '-DLIBVIRT_NSS_GUEST', ], dependencies: [ + json_c_dep, tools_dep, yajl_dep, ], -- 2.45.2

While the parsing is still done by 1K buffers, the results are no longer filtered during the parsing, but the whole JSON has to live in memory at once, which was also the case before the NSS plugin dropped its dependency on libvirt_util. Also, the new parser might be more forgiving of missing elements. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tools/nss/libvirt_nss_leases.c | 339 ++++++++++----------------------- 1 file changed, 96 insertions(+), 243 deletions(-) diff --git a/tools/nss/libvirt_nss_leases.c b/tools/nss/libvirt_nss_leases.c index 770dae8625..86bf184ea5 100644 --- a/tools/nss/libvirt_nss_leases.c +++ b/tools/nss/libvirt_nss_leases.c @@ -26,39 +26,11 @@ #include <stdbool.h> #include <fcntl.h> -#include <yajl/yajl_gen.h> -#include <yajl/yajl_parse.h> +#include <json.h> #include "libvirt_nss_leases.h" #include "libvirt_nss.h" -enum { - FIND_LEASES_STATE_START, - FIND_LEASES_STATE_LIST, - FIND_LEASES_STATE_ENTRY, -}; - - -typedef struct { - const char *name; - char **macs; - size_t nmacs; - int state; - unsigned long long now; - int af; - bool *found; - leaseAddress **addrs; - size_t *naddrs; - - char *key; - struct { - unsigned long long expiry; - char *ipaddr; - char *macaddr; - char *hostname; - } entry; -} findLeasesParser; - static int appendAddr(const char *name __attribute__((unused)), @@ -157,189 +129,102 @@ appendAddr(const char *name __attribute__((unused)), static int -findLeasesParserInteger(void *ctx, - long long val) +findLeaseInJSON(json_object *jobj, + const char *name, + char **macs, + size_t nmacs, + int af, + time_t now, + leaseAddress **addrs, + size_t *naddrs, + bool *found) { - findLeasesParser *parser = ctx; + size_t i, j; + int len; - DEBUG("Parse int state=%d '%lld' (map key '%s')", - parser->state, val, NULLSTR(parser->key)); - if (!parser->key) - return 0; - - if (parser->state == FIND_LEASES_STATE_ENTRY) { - if (strcmp(parser->key, "expiry-time")) - return 0; - - parser->entry.expiry = val; - } else { - return 0; + if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; } - return 1; -} + len = json_object_array_length(jobj); + for (i = 0; i < len; i++) { + json_object *lease = NULL; + json_object *expiry = NULL; + json_object *ipobj = NULL; + unsigned long long expiryTime; + const char *ipaddr; -static int -findLeasesParserString(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findLeasesParser *parser = ctx; + lease = json_object_array_get_idx(jobj, i); - DEBUG("Parse string state=%d '%.*s' (map key '%s')", - parser->state, (int)stringLen, (const char *)stringVal, - NULLSTR(parser->key)); - if (!parser->key) - return 0; + if (macs) { + const char *macAddr; + bool match = false; + json_object *val; - if (parser->state == FIND_LEASES_STATE_ENTRY) { - if (!strcmp(parser->key, "ip-address")) { - if (!(parser->entry.ipaddr = strndup((char *)stringVal, stringLen))) - return 0; - } else if (!strcmp(parser->key, "mac-address")) { - if (!(parser->entry.macaddr = strndup((char *)stringVal, stringLen))) - return 0; - } else if (!strcmp(parser->key, "hostname")) { - if (!(parser->entry.hostname = strndup((char *)stringVal, stringLen))) - return 0; + val = json_object_object_get(lease, "mac-address"); + if (!val) + continue; + + macAddr = json_object_get_string(val); + if (!macAddr) + continue; + + for (j = 0; j < nmacs; j++) { + if (!strcmp(macs[j], macAddr)) { + match = true; + break; + } + } + if (!match) + continue; } else { - return 1; - } - } else { - return 0; - } - return 1; -} - - -static int -findLeasesParserMapKey(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findLeasesParser *parser = ctx; - - DEBUG("Parse map key state=%d '%.*s'", - parser->state, (int)stringLen, (const char *)stringVal); - - free(parser->key); - if (!(parser->key = strndup((char *)stringVal, stringLen))) - return 0; - - return 1; -} - - -static int -findLeasesParserStartMap(void *ctx) -{ - findLeasesParser *parser = ctx; - - DEBUG("Parse start map state=%d", parser->state); - - if (parser->state != FIND_LEASES_STATE_LIST) - return 0; - - free(parser->key); - parser->key = NULL; - parser->state = FIND_LEASES_STATE_ENTRY; - - return 1; -} - - -static int -findLeasesParserEndMap(void *ctx) -{ - findLeasesParser *parser = ctx; - size_t i; - bool found = false; - - DEBUG("Parse end map state=%d", parser->state); + const char *leaseName; + json_object *val; - if (parser->entry.macaddr == NULL) - return 0; + val = json_object_object_get(lease, "hostname"); + if (!val) + continue; - if (parser->state != FIND_LEASES_STATE_ENTRY) - return 0; + leaseName = json_object_get_string(val); + if (!leaseName) + continue; - if (parser->nmacs) { - DEBUG("Check %zu macs", parser->nmacs); - for (i = 0; i < parser->nmacs && !found; i++) { - DEBUG("Check mac '%s' vs '%s'", parser->macs[i], NULLSTR(parser->entry.macaddr)); - if (parser->entry.macaddr && !strcmp(parser->macs[i], parser->entry.macaddr)) - found = true; + if (strcasecmp(leaseName, name)) + continue; } - } else { - DEBUG("Check name '%s' vs '%s'", parser->name, NULLSTR(parser->entry.hostname)); - if (parser->entry.hostname && !strcasecmp(parser->name, parser->entry.hostname)) - found = true; - } - DEBUG("Found %d", found); - if (parser->entry.expiry != 0 && - parser->entry.expiry < parser->now) { - DEBUG("Entry expired at %llu vs now %llu", - parser->entry.expiry, parser->now); - found = false; - } - if (!parser->entry.ipaddr) - found = false; - - if (found) { - *parser->found = true; - - if (appendAddr(parser->name, - parser->addrs, parser->naddrs, - parser->entry.ipaddr, - parser->entry.expiry, - parser->af) < 0) - return 0; - } - - free(parser->entry.macaddr); - free(parser->entry.ipaddr); - free(parser->entry.hostname); - parser->entry.expiry = 0; - parser->entry.macaddr = NULL; - parser->entry.ipaddr = NULL; - parser->entry.hostname = NULL; - parser->state = FIND_LEASES_STATE_LIST; - - return 1; -} + expiry = json_object_object_get(lease, "expiry-time"); + if (!expiry) { + ERROR("Missing expiry time for %s", name); + return -1; + } + expiryTime = json_object_get_uint64(expiry); + if (expiryTime && expiryTime < now) { + DEBUG("Skipping expired lease for %s", name); + continue; + } -static int -findLeasesParserStartArray(void *ctx) -{ - findLeasesParser *parser = ctx; + ipobj = json_object_object_get(lease, "ip-address"); + if (!ipobj) { + DEBUG("Missing IP address for %s", name); + continue; + } + ipaddr = json_object_get_string(ipobj); - DEBUG("Parse start array state=%d", parser->state); + DEBUG("Found record for %s", name); + *found = true; - if (parser->state == FIND_LEASES_STATE_START) { - parser->state = FIND_LEASES_STATE_LIST; - } else { - return 0; + if (appendAddr(name, + addrs, naddrs, + ipaddr, + expiryTime, + af) < 0) + return -1; } - return 1; -} - - -static int -findLeasesParserEndArray(void *ctx) -{ - findLeasesParser *parser = ctx; - - DEBUG("Parse end array state=%d", parser->state); - - if (parser->state == FIND_LEASES_STATE_LIST) - parser->state = FIND_LEASES_STATE_START; - else - return 0; - - return 1; + return 0; } @@ -356,30 +241,10 @@ findLeases(const char *file, { int fd = -1; int ret = -1; - const yajl_callbacks parserCallbacks = { - NULL, /* null */ - NULL, /* bool */ - findLeasesParserInteger, - NULL, /* double */ - NULL, /* number */ - findLeasesParserString, - findLeasesParserStartMap, - findLeasesParserMapKey, - findLeasesParserEndMap, - findLeasesParserStartArray, - findLeasesParserEndArray, - }; - findLeasesParser parserState = { - .name = name, - .macs = macs, - .nmacs = nmacs, - .af = af, - .now = now, - .found = found, - .addrs = addrs, - .naddrs = naddrs, - }; - yajl_handle parser = NULL; + json_object *jobj = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr = json_tokener_success; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; char line[1024]; ssize_t nreadTotal = 0; int rv; @@ -389,51 +254,39 @@ findLeases(const char *file, goto cleanup; } - parser = yajl_alloc(&parserCallbacks, NULL, &parserState); - if (!parser) { - ERROR("Unable to create JSON parser"); - goto cleanup; - } + tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags); - while (1) { - rv = read(fd, line, sizeof(line)); + while (jerr != json_tokener_continue) { + rv = read(fd, line, sizeof(line) - 1); if (rv < 0) goto cleanup; if (rv == 0) break; nreadTotal += rv; - if (yajl_parse(parser, (const unsigned char *)line, rv) != - yajl_status_ok) { - unsigned char *err = yajl_get_error(parser, 1, - (const unsigned char*)line, rv); - ERROR("Parse failed %s", (const char *) err); - yajl_free_error(parser, err); - goto cleanup; - } + line[rv] = 0; + + jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); } - if (nreadTotal > 0 && - yajl_complete_parse(parser) != yajl_status_ok) { - ERROR("Parse failed %s", - yajl_get_error(parser, 1, NULL, 0)); + if (nreadTotal > 0 && jerr != json_tokener_success) { + ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr)); goto cleanup; } - ret = 0; + ret = findLeaseInJSON(jobj, name, macs, nmacs, af, now, + addrs, naddrs, found); cleanup: + json_object_put(jobj); + json_tokener_free(tok); if (ret != 0) { free(*addrs); *addrs = NULL; *naddrs = 0; } - if (parser) - yajl_free(parser); - free(parserState.entry.ipaddr); - free(parserState.entry.macaddr); - free(parserState.entry.hostname); - free(parserState.key); if (fd != -1) close(fd); return ret; -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:25 +0200, Ján Tomko wrote:
While the parsing is still done by 1K buffers, the results are no longer filtered during the parsing, but the whole JSON has to live in memory at once, which was also the case before the NSS plugin dropped its dependency on libvirt_util.
Also, the new parser might be more forgiving of missing elements.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tools/nss/libvirt_nss_leases.c | 339 ++++++++++----------------------- 1 file changed, 96 insertions(+), 243 deletions(-)
diff --git a/tools/nss/libvirt_nss_leases.c b/tools/nss/libvirt_nss_leases.c index 770dae8625..86bf184ea5 100644 --- a/tools/nss/libvirt_nss_leases.c +++ b/tools/nss/libvirt_nss_leases.c @@ -26,39 +26,11 @@ #include <stdbool.h> #include <fcntl.h>
-#include <yajl/yajl_gen.h> -#include <yajl/yajl_parse.h> +#include <json.h>
So at this point meson will try to build this based on whether yajl is present but this fully switches to json-c. I think you'll need to merge in both the link statements and also the meson changes to ensure this is compiled correctly. Obviously that's in the case when you don't want to have two side-by-side impls as we have in util/virjson.c at this point.
#include "libvirt_nss_leases.h" #include "libvirt_nss.h"
-enum { - FIND_LEASES_STATE_START, - FIND_LEASES_STATE_LIST, - FIND_LEASES_STATE_ENTRY, -}; - - -typedef struct { - const char *name; - char **macs; - size_t nmacs; - int state; - unsigned long long now; - int af; - bool *found; - leaseAddress **addrs; - size_t *naddrs; - - char *key; - struct { - unsigned long long expiry; - char *ipaddr; - char *macaddr; - char *hostname; - } entry; -} findLeasesParser; -
static int appendAddr(const char *name __attribute__((unused)), @@ -157,189 +129,102 @@ appendAddr(const char *name __attribute__((unused)),
static int -findLeasesParserInteger(void *ctx, - long long val)
Please document this function/arguments so that it's easier to understand for the next person. Yes I do realize that the current version is absolutely undocumented.
+findLeaseInJSON(json_object *jobj, + const char *name, + char **macs, + size_t nmacs, + int af, + time_t now, + leaseAddress **addrs, + size_t *naddrs, + bool *found)
Uhh, this diff will be very hard to review, based on how useless git decided to make this diff.. I've resorted to looking just at the new code after this patch mostly and will try to find the matching code to comment.
{ - findLeasesParser *parser = ctx; + size_t i, j;
One per line. Also 'j' is used only in one of the innter blocks, so declare it there?
+ int len;
- DEBUG("Parse int state=%d '%lld' (map key '%s')", - parser->state, val, NULLSTR(parser->key)); - if (!parser->key) - return 0; - - if (parser->state == FIND_LEASES_STATE_ENTRY) { - if (strcmp(parser->key, "expiry-time")) - return 0; - - parser->entry.expiry = val; - } else { - return 0; + if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; } - return 1; -}
+ len = json_object_array_length(jobj); + for (i = 0; i < len; i++) { + json_object *lease = NULL; + json_object *expiry = NULL; + json_object *ipobj = NULL; + unsigned long long expiryTime; + const char *ipaddr;
-static int -findLeasesParserString(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findLeasesParser *parser = ctx; + lease = json_object_array_get_idx(jobj, i);
- DEBUG("Parse string state=%d '%.*s' (map key '%s')", - parser->state, (int)stringLen, (const char *)stringVal, - NULLSTR(parser->key)); - if (!parser->key) - return 0; + if (macs) { + const char *macAddr; + bool match = false; + json_object *val;
- if (parser->state == FIND_LEASES_STATE_ENTRY) { - if (!strcmp(parser->key, "ip-address")) { - if (!(parser->entry.ipaddr = strndup((char *)stringVal, stringLen))) - return 0; - } else if (!strcmp(parser->key, "mac-address")) { - if (!(parser->entry.macaddr = strndup((char *)stringVal, stringLen))) - return 0; - } else if (!strcmp(parser->key, "hostname")) { - if (!(parser->entry.hostname = strndup((char *)stringVal, stringLen))) - return 0; + val = json_object_object_get(lease, "mac-address"); + if (!val) + continue; + + macAddr = json_object_get_string(val); + if (!macAddr) + continue; + + for (j = 0; j < nmacs; j++) { + if (!strcmp(macs[j], macAddr)) { + match = true; + break; + } + } + if (!match) + continue; } else { - return 1; - } - } else { - return 0; - } - return 1; -} - - -static int -findLeasesParserMapKey(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findLeasesParser *parser = ctx; - - DEBUG("Parse map key state=%d '%.*s'", - parser->state, (int)stringLen, (const char *)stringVal); - - free(parser->key); - if (!(parser->key = strndup((char *)stringVal, stringLen))) - return 0; - - return 1; -} - - -static int -findLeasesParserStartMap(void *ctx) -{ - findLeasesParser *parser = ctx; - - DEBUG("Parse start map state=%d", parser->state); - - if (parser->state != FIND_LEASES_STATE_LIST) - return 0; - - free(parser->key); - parser->key = NULL; - parser->state = FIND_LEASES_STATE_ENTRY; - - return 1; -} - - -static int -findLeasesParserEndMap(void *ctx) -{ - findLeasesParser *parser = ctx; - size_t i; - bool found = false; - - DEBUG("Parse end map state=%d", parser->state); + const char *leaseName; + json_object *val;
- if (parser->entry.macaddr == NULL) - return 0; + val = json_object_object_get(lease, "hostname"); + if (!val) + continue;
- if (parser->state != FIND_LEASES_STATE_ENTRY) - return 0; + leaseName = json_object_get_string(val); + if (!leaseName) + continue;
- if (parser->nmacs) { - DEBUG("Check %zu macs", parser->nmacs); - for (i = 0; i < parser->nmacs && !found; i++) { - DEBUG("Check mac '%s' vs '%s'", parser->macs[i], NULLSTR(parser->entry.macaddr)); - if (parser->entry.macaddr && !strcmp(parser->macs[i], parser->entry.macaddr)) - found = true; + if (strcasecmp(leaseName, name)) + continue;
So this looks broken. You skip the processing if the requested name *doesn't equal* to the lease name. I very strongly suggest adding explicit comparison with 0 for str*cmp.
} - } else { - DEBUG("Check name '%s' vs '%s'", parser->name, NULLSTR(parser->entry.hostname)); - if (parser->entry.hostname && !strcasecmp(parser->name, parser->entry.hostname)) - found = true; - } - DEBUG("Found %d", found); - if (parser->entry.expiry != 0 && - parser->entry.expiry < parser->now) { - DEBUG("Entry expired at %llu vs now %llu", - parser->entry.expiry, parser->now); - found = false; - } - if (!parser->entry.ipaddr) - found = false; - - if (found) { - *parser->found = true; - - if (appendAddr(parser->name, - parser->addrs, parser->naddrs, - parser->entry.ipaddr, - parser->entry.expiry, - parser->af) < 0) - return 0; - } - - free(parser->entry.macaddr); - free(parser->entry.ipaddr); - free(parser->entry.hostname); - parser->entry.expiry = 0; - parser->entry.macaddr = NULL; - parser->entry.ipaddr = NULL; - parser->entry.hostname = NULL;
- parser->state = FIND_LEASES_STATE_LIST; - - return 1; -} + expiry = json_object_object_get(lease, "expiry-time"); + if (!expiry) { + ERROR("Missing expiry time for %s", name); + return -1; + }
+ expiryTime = json_object_get_uint64(expiry); + if (expiryTime && expiryTime < now) {
since expiryTime is a number and you are checking that it's non-zero, please use explicit check so that it's obvious.
+ DEBUG("Skipping expired lease for %s", name); + continue; + }
-static int -findLeasesParserStartArray(void *ctx) -{ - findLeasesParser *parser = ctx; + ipobj = json_object_object_get(lease, "ip-address"); + if (!ipobj) { + DEBUG("Missing IP address for %s", name); + continue; + } + ipaddr = json_object_get_string(ipobj);
- DEBUG("Parse start array state=%d", parser->state); + DEBUG("Found record for %s", name); + *found = true;
- if (parser->state == FIND_LEASES_STATE_START) { - parser->state = FIND_LEASES_STATE_LIST; - } else { - return 0; + if (appendAddr(name, + addrs, naddrs, + ipaddr, + expiryTime, + af) < 0) + return -1; }
- return 1; -} - - -static int -findLeasesParserEndArray(void *ctx) -{ - findLeasesParser *parser = ctx; - - DEBUG("Parse end array state=%d", parser->state); - - if (parser->state == FIND_LEASES_STATE_LIST) - parser->state = FIND_LEASES_STATE_START; - else - return 0; - - return 1; + return 0; }
@@ -356,30 +241,10 @@ findLeases(const char *file,
[...]
+ json_object *jobj = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr = json_tokener_success;
You set this here to 'json_tokener_success'
+ int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; char line[1024]; ssize_t nreadTotal = 0; int rv; @@ -389,51 +254,39 @@ findLeases(const char *file, goto cleanup; }
- parser = yajl_alloc(&parserCallbacks, NULL, &parserState); - if (!parser) { - ERROR("Unable to create JSON parser"); - goto cleanup; - } + tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags);
- while (1) { - rv = read(fd, line, sizeof(line)); + while (jerr != json_tokener_continue) {
So this passes on first iteration, but ...
+ rv = read(fd, line, sizeof(line) - 1); if (rv < 0) goto cleanup; if (rv == 0) break; nreadTotal += rv;
- if (yajl_parse(parser, (const unsigned char *)line, rv) != - yajl_status_ok) { - unsigned char *err = yajl_get_error(parser, 1, - (const unsigned char*)line, rv); - ERROR("Parse failed %s", (const char *) err); - yajl_free_error(parser, err); - goto cleanup; - } + line[rv] = 0;
Why is this needed ...
+ + jobj = json_tokener_parse_ex(tok, line, rv);
... this seems to accept a length argument.
+ jerr = json_tokener_get_error(tok);
... the docs state: A partial JSON string can be parsed. If the parsing is incomplete, NULL will be returned and json_tokener_get_error() will be return json_tokener_continue. json_tokener_parse_ex() can then be called with additional bytes in str to continue the parsing. So unless I'm missing something very important this will not be able to parse a file larger than 1k.
}
- if (nreadTotal > 0 && - yajl_complete_parse(parser) != yajl_status_ok) { - ERROR("Parse failed %s", - yajl_get_error(parser, 1, NULL, 0)); + if (nreadTotal > 0 && jerr != json_tokener_success) { + ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr)); goto cleanup; }

On Mon, Aug 19, 2024 at 13:52:18 +0200, Peter Krempa wrote:
On Wed, Aug 14, 2024 at 23:40:25 +0200, Ján Tomko wrote:
While the parsing is still done by 1K buffers, the results are no longer filtered during the parsing, but the whole JSON has to live in memory at once, which was also the case before the NSS plugin dropped its dependency on libvirt_util.
Also, the new parser might be more forgiving of missing elements.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tools/nss/libvirt_nss_leases.c | 339 ++++++++++----------------------- 1 file changed, 96 insertions(+), 243 deletions(-)
[...]
- while (1) { - rv = read(fd, line, sizeof(line)); + while (jerr != json_tokener_continue) {
So this passes on first iteration, but ...
+ rv = read(fd, line, sizeof(line) - 1); if (rv < 0) goto cleanup; if (rv == 0) break; nreadTotal += rv;
- if (yajl_parse(parser, (const unsigned char *)line, rv) != - yajl_status_ok) { - unsigned char *err = yajl_get_error(parser, 1, - (const unsigned char*)line, rv); - ERROR("Parse failed %s", (const char *) err); - yajl_free_error(parser, err); - goto cleanup; - } + line[rv] = 0;
Why is this needed ...
+ + jobj = json_tokener_parse_ex(tok, line, rv);
... this seems to accept a length argument.
+ jerr = json_tokener_get_error(tok);
... the docs state:
A partial JSON string can be parsed. If the parsing is incomplete, NULL will be returned and json_tokener_get_error() will be return json_tokener_continue. json_tokener_parse_ex() can then be called with additional bytes in str to continue the parsing.
So unless I'm missing something very important this will not be able to parse a file larger than 1k.
}
- if (nreadTotal > 0 && - yajl_complete_parse(parser) != yajl_status_ok) { - ERROR("Parse failed %s", - yajl_get_error(parser, 1, NULL, 0)); + if (nreadTotal > 0 && jerr != json_tokener_success) { + ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr)); goto cleanup; }
Also at this point if no bytes were read the original code would skip any parsing and return nothihg. You unconditionally call 'findLeaseInJSON' with 'jobj' argument being NULL, which in better case will result in ERROR("parsed JSON does not contain the leases array"); and in the worse outcome the code will crash.

While the parsing is still done by 1K buffers, the results are no longer filtered during the parsing, but the whole JSON has to live in memory at once, which was also the case before the NSS plugin dropped its dependency on libvirt_util. Also, the new parser might be more forgiving of missing elements. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tools/nss/libvirt_nss_macs.c | 263 +++++++++-------------------------- 1 file changed, 68 insertions(+), 195 deletions(-) diff --git a/tools/nss/libvirt_nss_macs.c b/tools/nss/libvirt_nss_macs.c index f45d149793..dbc0790945 100644 --- a/tools/nss/libvirt_nss_macs.c +++ b/tools/nss/libvirt_nss_macs.c @@ -25,179 +25,78 @@ #include <stdlib.h> #include <fcntl.h> -#include <yajl/yajl_gen.h> -#include <yajl/yajl_parse.h> +#include <json.h> #include "libvirt_nss_macs.h" #include "libvirt_nss.h" -enum { - FIND_MACS_STATE_START, - FIND_MACS_STATE_LIST, - FIND_MACS_STATE_ENTRY, - FIND_MACS_STATE_ENTRY_MACS, -}; - -typedef struct { - const char *name; - char ***macs; - size_t *nmacs; - int state; - - char *key; - struct { - char *name; - char **macs; - size_t nmacs; - } entry; -} findMACsParser; - static int -findMACsParserString(void *ctx, - const unsigned char *stringVal, - size_t stringLen) +findMACsFromJSON(json_object *jobj, + const char *name, + char ***macs, + size_t *nmacs) { - findMACsParser *parser = ctx; - - DEBUG("Parse string state=%d '%.*s' (map key '%s')", - parser->state, (int)stringLen, (const char *)stringVal, - NULLSTR(parser->key)); - if (!parser->key) - return 0; - - if (parser->state == FIND_MACS_STATE_ENTRY) { - if (strcmp(parser->key, "domain")) - return 1; - - free(parser->entry.name); - if (!(parser->entry.name = strndup((char *)stringVal, stringLen))) - return 0; - } else if (parser->state == FIND_MACS_STATE_ENTRY_MACS) { - char **macs; - if (strcmp(parser->key, "macs")) - return 1; + size_t i, j; + int len; - if (!(macs = realloc(parser->entry.macs, - sizeof(char *) * (parser->entry.nmacs + 1)))) - return 0; - - parser->entry.macs = macs; - if (!(macs[parser->entry.nmacs++] = strndup((char *)stringVal, stringLen))) - return 0; - } else { - return 0; + if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; } - return 1; -} - - -static int -findMACsParserMapKey(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findMACsParser *parser = ctx; - - DEBUG("Parse map key state=%d '%.*s'", - parser->state, (int)stringLen, (const char *)stringVal); - - free(parser->key); - if (!(parser->key = strndup((char *)stringVal, stringLen))) - return 0; - - return 1; -} - - -static int -findMACsParserStartMap(void *ctx) -{ - findMACsParser *parser = ctx; - DEBUG("Parse start map state=%d", parser->state); + len = json_object_array_length(jobj); + DEBUG("Found an array of length: %zu", len); + for (i = 0; i < len; i++) { + json_object *entry = NULL; + json_object *domain = NULL; + const char *domainName; + char **tmpMacs = NULL; + size_t newmacs = 0; + json_object *macsArray = NULL; - if (parser->state != FIND_MACS_STATE_LIST) - return 0; + entry = json_object_array_get_idx(jobj, i); + if (!entry) + return -1; - free(parser->key); - parser->key = NULL; - parser->state = FIND_MACS_STATE_ENTRY; + DEBUG("Processing item %zu", i); - return 1; -} + domain = json_object_object_get(entry, "domain"); + if (!domain) + return -1; + domainName = json_object_get_string(domain); + if (!domainName) + return -1; -static int -findMACsParserEndMap(void *ctx) -{ - findMACsParser *parser = ctx; - size_t i; + DEBUG("Processing domain %s", domainName); - DEBUG("Parse end map state=%d", parser->state); + if (strcasecmp(domainName, name)) + continue; - if (parser->entry.name == NULL) - return 0; + macsArray = json_object_object_get(entry, "macs"); + if (!macsArray) + return -1; - if (parser->state != FIND_MACS_STATE_ENTRY) - return 0; + newmacs = json_object_array_length(macsArray); + DEBUG("Found %zu MAC addresses", newmacs); - if (!strcasecmp(parser->entry.name, parser->name)) { - char **macs = realloc(*parser->macs, - sizeof(char *) * ((*parser->nmacs) + parser->entry.nmacs)); - if (!macs) + tmpMacs = realloc(*macs, sizeof(char *) * (*nmacs + newmacs + 1)); + if (!tmpMacs) return 0; - *parser->macs = macs; - for (i = 0; i < parser->entry.nmacs; i++) - (*parser->macs)[(*parser->nmacs)++] = parser->entry.macs[i]; - } else { - for (i = 0; i < parser->entry.nmacs; i++) - free(parser->entry.macs[i]); - } - free(parser->entry.macs); - parser->entry.macs = NULL; - parser->entry.nmacs = 0; - - parser->state = FIND_MACS_STATE_LIST; - - return 1; -} - - -static int -findMACsParserStartArray(void *ctx) -{ - findMACsParser *parser = ctx; - - DEBUG("Parse start array state=%d", parser->state); - - if (parser->state == FIND_MACS_STATE_START) - parser->state = FIND_MACS_STATE_LIST; - else if (parser->state == FIND_MACS_STATE_ENTRY) - parser->state = FIND_MACS_STATE_ENTRY_MACS; - else - return 0; + *macs = tmpMacs; - return 1; -} + for (j = 0; j < newmacs; j++) { + json_object *macobj = NULL; + DEBUG("j: %zu", j); -static int -findMACsParserEndArray(void *ctx) -{ - findMACsParser *parser = ctx; - - DEBUG("Parse end array state=%d", parser->state); - - if (parser->state == FIND_MACS_STATE_LIST) - parser->state = FIND_MACS_STATE_START; - else if (parser->state == FIND_MACS_STATE_ENTRY_MACS) - parser->state = FIND_MACS_STATE_ENTRY; - else - return 0; - - return 1; + macobj = json_object_array_get_idx(macsArray, j); + (*macs)[(*nmacs)++] = strdup(json_object_get_string(macobj)); + } + } + return 0; } @@ -209,66 +108,47 @@ findMACs(const char *file, { int fd = -1; int ret = -1; - const yajl_callbacks parserCallbacks = { - NULL, /* null */ - NULL, /* bool */ - NULL, /* integer */ - NULL, /* double */ - NULL, /* number */ - findMACsParserString, - findMACsParserStartMap, - findMACsParserMapKey, - findMACsParserEndMap, - findMACsParserStartArray, - findMACsParserEndArray, - }; - findMACsParser parserState = { - .name = name, - .macs = macs, - .nmacs = nmacs, - }; - yajl_handle parser = NULL; char line[1024]; - size_t i; + json_object *jobj = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr = json_tokener_success; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; + ssize_t nreadTotal = 0; int rv; + size_t i; if ((fd = open(file, O_RDONLY)) < 0) { ERROR("Cannot open %s", file); goto cleanup; } - parser = yajl_alloc(&parserCallbacks, NULL, &parserState); - if (!parser) { - ERROR("Unable to create JSON parser"); - goto cleanup; - } + tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags); - while (1) { - rv = read(fd, line, sizeof(line)); + while (jerr != json_tokener_continue) { + rv = read(fd, line, sizeof(line) - 1); if (rv < 0) goto cleanup; if (rv == 0) break; + nreadTotal += rv; - if (yajl_parse(parser, (const unsigned char *)line, rv) != - yajl_status_ok) { - unsigned char *err = yajl_get_error(parser, 1, - (const unsigned char*)line, rv); - ERROR("Parse failed %s", (const char *) err); - yajl_free_error(parser, err); - goto cleanup; - } + line[rv] = 0; + + jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); } - if (yajl_complete_parse(parser) != yajl_status_ok) { - ERROR("Parse failed %s", - yajl_get_error(parser, 1, NULL, 0)); + if (nreadTotal > 0 && jerr != json_tokener_success) { + ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr)); goto cleanup; } - ret = 0; + ret = findMACsFromJSON(jobj, name, macs, nmacs); cleanup: + json_object_put(jobj); + json_tokener_free(tok); if (ret != 0) { for (i = 0; i < *nmacs; i++) { char *mac = (*macs)[i]; @@ -278,13 +158,6 @@ findMACs(const char *file, *macs = NULL; *nmacs = 0; } - if (parser) - yajl_free(parser); - for (i = 0; i < parserState.entry.nmacs; i++) - free(parserState.entry.macs[i]); - free(parserState.entry.macs); - free(parserState.entry.name); - free(parserState.key); if (fd != -1) close(fd); return ret; -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:26 +0200, Ján Tomko wrote:
While the parsing is still done by 1K buffers, the results are no longer filtered during the parsing, but the whole JSON has to live in memory at once, which was also the case before the NSS plugin dropped its dependency on libvirt_util.
Also, the new parser might be more forgiving of missing elements.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tools/nss/libvirt_nss_macs.c | 263 +++++++++-------------------------- 1 file changed, 68 insertions(+), 195 deletions(-)
diff --git a/tools/nss/libvirt_nss_macs.c b/tools/nss/libvirt_nss_macs.c index f45d149793..dbc0790945 100644 --- a/tools/nss/libvirt_nss_macs.c +++ b/tools/nss/libvirt_nss_macs.c @@ -25,179 +25,78 @@ #include <stdlib.h> #include <fcntl.h>
-#include <yajl/yajl_gen.h> -#include <yajl/yajl_parse.h> +#include <json.h>
Same issue with linking as outlined in previous patch.
#include "libvirt_nss_macs.h" #include "libvirt_nss.h"
-enum { - FIND_MACS_STATE_START, - FIND_MACS_STATE_LIST, - FIND_MACS_STATE_ENTRY, - FIND_MACS_STATE_ENTRY_MACS, -}; - -typedef struct { - const char *name; - char ***macs; - size_t *nmacs; - int state; - - char *key; - struct { - char *name; - char **macs; - size_t nmacs; - } entry; -} findMACsParser; -
static int -findMACsParserString(void *ctx, - const unsigned char *stringVal, - size_t stringLen)
As before please document this.
+findMACsFromJSON(json_object *jobj, + const char *name, + char ***macs, + size_t *nmacs) { - findMACsParser *parser = ctx; - - DEBUG("Parse string state=%d '%.*s' (map key '%s')", - parser->state, (int)stringLen, (const char *)stringVal, - NULLSTR(parser->key)); - if (!parser->key) - return 0; - - if (parser->state == FIND_MACS_STATE_ENTRY) { - if (strcmp(parser->key, "domain")) - return 1; - - free(parser->entry.name); - if (!(parser->entry.name = strndup((char *)stringVal, stringLen))) - return 0; - } else if (parser->state == FIND_MACS_STATE_ENTRY_MACS) { - char **macs; - if (strcmp(parser->key, "macs")) - return 1; + size_t i, j;
One per line.
+ int len;
- if (!(macs = realloc(parser->entry.macs, - sizeof(char *) * (parser->entry.nmacs + 1)))) - return 0; - - parser->entry.macs = macs; - if (!(macs[parser->entry.nmacs++] = strndup((char *)stringVal, stringLen))) - return 0; - } else { - return 0; + if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; } - return 1; -} - - -static int -findMACsParserMapKey(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findMACsParser *parser = ctx; - - DEBUG("Parse map key state=%d '%.*s'", - parser->state, (int)stringLen, (const char *)stringVal); - - free(parser->key); - if (!(parser->key = strndup((char *)stringVal, stringLen))) - return 0; - - return 1; -} - - -static int -findMACsParserStartMap(void *ctx) -{ - findMACsParser *parser = ctx;
- DEBUG("Parse start map state=%d", parser->state); + len = json_object_array_length(jobj); + DEBUG("Found an array of length: %zu", len); + for (i = 0; i < len; i++) { + json_object *entry = NULL; + json_object *domain = NULL; + const char *domainName; + char **tmpMacs = NULL; + size_t newmacs = 0; + json_object *macsArray = NULL;
- if (parser->state != FIND_MACS_STATE_LIST) - return 0; + entry = json_object_array_get_idx(jobj, i); + if (!entry) + return -1;
- free(parser->key); - parser->key = NULL; - parser->state = FIND_MACS_STATE_ENTRY; + DEBUG("Processing item %zu", i);
- return 1; -} + domain = json_object_object_get(entry, "domain"); + if (!domain) + return -1;
+ domainName = json_object_get_string(domain); + if (!domainName) + return -1;
No error reporting in any of these? If no shouldn't this continue processing the loop? (also below)
-static int -findMACsParserEndMap(void *ctx) -{ - findMACsParser *parser = ctx; - size_t i; + DEBUG("Processing domain %s", domainName);
- DEBUG("Parse end map state=%d", parser->state); + if (strcasecmp(domainName, name)) + continue;
- if (parser->entry.name == NULL) - return 0; + macsArray = json_object_object_get(entry, "macs"); + if (!macsArray) + return -1;
- if (parser->state != FIND_MACS_STATE_ENTRY) - return 0; + newmacs = json_object_array_length(macsArray); + DEBUG("Found %zu MAC addresses", newmacs);
- if (!strcasecmp(parser->entry.name, parser->name)) { - char **macs = realloc(*parser->macs, - sizeof(char *) * ((*parser->nmacs) + parser->entry.nmacs)); - if (!macs) + tmpMacs = realloc(*macs, sizeof(char *) * (*nmacs + newmacs + 1)); + if (!tmpMacs) return 0;
So allocation failure is success?
- *parser->macs = macs; - for (i = 0; i < parser->entry.nmacs; i++) - (*parser->macs)[(*parser->nmacs)++] = parser->entry.macs[i]; - } else { - for (i = 0; i < parser->entry.nmacs; i++) - free(parser->entry.macs[i]); - } - free(parser->entry.macs); - parser->entry.macs = NULL; - parser->entry.nmacs = 0; - - parser->state = FIND_MACS_STATE_LIST; - - return 1; -} - - -static int -findMACsParserStartArray(void *ctx) -{ - findMACsParser *parser = ctx; - - DEBUG("Parse start array state=%d", parser->state); - - if (parser->state == FIND_MACS_STATE_START) - parser->state = FIND_MACS_STATE_LIST; - else if (parser->state == FIND_MACS_STATE_ENTRY) - parser->state = FIND_MACS_STATE_ENTRY_MACS; - else - return 0; + *macs = tmpMacs;
- return 1; -} + for (j = 0; j < newmacs; j++) { + json_object *macobj = NULL;
+ DEBUG("j: %zu", j);
This doesn't sound very useful.
-static int -findMACsParserEndArray(void *ctx) -{ - findMACsParser *parser = ctx; - - DEBUG("Parse end array state=%d", parser->state); - - if (parser->state == FIND_MACS_STATE_LIST) - parser->state = FIND_MACS_STATE_START; - else if (parser->state == FIND_MACS_STATE_ENTRY_MACS) - parser->state = FIND_MACS_STATE_ENTRY; - else - return 0; - - return 1; + macobj = json_object_array_get_idx(macsArray, j); + (*macs)[(*nmacs)++] = strdup(json_object_get_string(macobj));
No return value check from strdup (since you are checking realloc).
+ } + } + return 0; }
@@ -209,66 +108,47 @@ findMACs(const char *file, { int fd = -1; int ret = -1; - const yajl_callbacks parserCallbacks = { - NULL, /* null */ - NULL, /* bool */ - NULL, /* integer */ - NULL, /* double */ - NULL, /* number */ - findMACsParserString, - findMACsParserStartMap, - findMACsParserMapKey, - findMACsParserEndMap, - findMACsParserStartArray, - findMACsParserEndArray, - }; - findMACsParser parserState = { - .name = name, - .macs = macs, - .nmacs = nmacs, - }; - yajl_handle parser = NULL; char line[1024]; - size_t i; + json_object *jobj = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr = json_tokener_success; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; + ssize_t nreadTotal = 0; int rv; + size_t i;
if ((fd = open(file, O_RDONLY)) < 0) { ERROR("Cannot open %s", file); goto cleanup; }
- parser = yajl_alloc(&parserCallbacks, NULL, &parserState); - if (!parser) { - ERROR("Unable to create JSON parser"); - goto cleanup; - } + tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags);
- while (1) { - rv = read(fd, line, sizeof(line)); + while (jerr != json_tokener_continue) { + rv = read(fd, line, sizeof(line) - 1); if (rv < 0) goto cleanup; if (rv == 0) break; + nreadTotal += rv;
- if (yajl_parse(parser, (const unsigned char *)line, rv) != - yajl_status_ok) { - unsigned char *err = yajl_get_error(parser, 1, - (const unsigned char*)line, rv); - ERROR("Parse failed %s", (const char *) err); - yajl_free_error(parser, err); - goto cleanup; - } + line[rv] = 0; + + jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); }
- if (yajl_complete_parse(parser) != yajl_status_ok) { - ERROR("Parse failed %s", - yajl_get_error(parser, 1, NULL, 0)); + if (nreadTotal > 0 && jerr != json_tokener_success) { + ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr)); goto cleanup; }
- ret = 0; + ret = findMACsFromJSON(jobj, name, macs, nmacs);
Same issues with the parser as in patch before.

After the series finale, there will be no WITH_YAJL anymore. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tests/meson.build | 6 +++--- tests/virnetdaemontest.c | 2 +- tests/virstoragetest.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index d1fc122fc7..d6e73bfba0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -330,7 +330,7 @@ if host_machine.system() == 'linux' { 'name': 'virscsitest' }, { 'name': 'virusbtest' }, ] - if conf.has('WITH_YAJL') + if conf.has('WITH_JSON_C') tests += [ { 'name': 'virnetdevopenvswitchtest' }, ] @@ -407,7 +407,7 @@ if conf.has('WITH_NETWORK') ] endif -if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_YAJL') +if conf.has('WITH_NODE_DEVICES') and conf.has('WITH_JSON_C') tests += [ { 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] }, ] @@ -556,7 +556,7 @@ if conf.has('WITH_VMX') ] endif -if conf.has('WITH_YAJL') +if conf.has('WITH_JSON_C') tests += [ { 'name': 'virjsontest' }, { 'name': 'virmacmaptest' }, diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 74c20479d4..3c00c55c72 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -26,7 +26,7 @@ #define VIR_FROM_THIS VIR_FROM_RPC -#if !defined(WIN32) && defined(WITH_YAJL) +#if !defined(WIN32) && defined(WITH_JSON_C) struct testClientPriv { int magic; }; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index d07a05d04b..91c389dead 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -815,7 +815,7 @@ mymain(void) " <host name='example.org' port='1234'/>\n" "</source>\n", 1); -#ifdef WITH_YAJL +#ifdef WITH_JSON_C TEST_BACKING_PARSE("json:", NULL); TEST_BACKING_PARSE("json:asdgsdfg", NULL); TEST_BACKING_PARSE("json:{}", NULL); @@ -1192,7 +1192,7 @@ mymain(void) " <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>\n" "</source>\n"); -#endif /* WITH_YAJL */ +#endif /* WITH_JSON_C */ return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:27 +0200, Ján Tomko wrote:
After the series finale, there will be no WITH_YAJL anymore.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- tests/meson.build | 6 +++--- tests/virnetdaemontest.c | 2 +- tests/virstoragetest.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/meson.build b/tests/meson.build index d1fc122fc7..d6e73bfba0 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -330,7 +330,7 @@ if host_machine.system() == 'linux' { 'name': 'virscsitest' }, { 'name': 'virusbtest' }, ] - if conf.has('WITH_YAJL') + if conf.has('WITH_JSON_C')
Shouldn't we introduce "WITH_JSON" and use that across these checks? The specific library-dependant defines can be then used where it actually matters. The above may be useful also in other cases such as if you'll want to fix the rollover to the new library in the '*nss*' files which do not get an interim implementation with both YAJL and json-c.

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 39d6d700d3..837b209232 100644 --- a/meson.build +++ b/meson.build @@ -1620,10 +1620,10 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a endif endif - if not yajl_dep.found() + if not json_c_dep.found() use_ch = false if get_option('driver_ch').enabled() - error('YAJL 2 is required to build Cloud-Hypervisor driver') + error('json-c is required to build Cloud-Hypervisor driver') endif endif @@ -1694,10 +1694,10 @@ endif if not get_option('driver_qemu').disabled() use_qemu = true - if not yajl_dep.found() + if not json_c_dep.found() use_qemu = false if get_option('driver_qemu').enabled() - error('YAJL 2 is required to build QEMU driver') + error('json-c is required to build QEMU driver') endif endif @@ -2027,9 +2027,9 @@ endif if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() + if not json_c_dep.found() if get_option('nss').enabled() - error('Can\'t build nss plugin without yajl') + error('Can\'t build nss plugin without json-c') else use_nss = false endif -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:28 +0200, Ján Tomko wrote:
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
[...]
@@ -2027,9 +2027,9 @@ endif
if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() + if not json_c_dep.found() if get_option('nss').enabled() - error('Can\'t build nss plugin without yajl') + error('Can\'t build nss plugin without json-c') else use_nss = false endif
At least this will need to be part of the patch that refactors the parsing in the NSS modules.

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson_options.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 9b1610fcfe..122cda0350 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -68,14 +68,14 @@ option('driver_libvirtd', type: 'feature', value: 'auto', description: 'libvirtd option('driver_libxl', type: 'feature', value: 'auto', description: 'libxenlight driver') # dep:driver_remote dep:driver_libvirtd option('driver_lxc', type: 'feature', value: 'auto', description: 'Linux Container driver') -# dep:curl dep:yajl dep:driver_remote dep:driver_libvirtd +# dep:curl dep:json_c dep:driver_remote dep:driver_libvirtd option('driver_ch', type: 'feature', value: 'auto', description: 'Cloud-Hypervisor driver') option('ch_user', type: 'string', value: '', description: 'username to run Cloud-Hypervisor system instance as') option('ch_group', type: 'string', value: '', description: 'groupname to run Cloud-Hypervisor system instance as') # dep:driver_remote dep:driver_libvirtd option('driver_network', type: 'feature', value: 'auto', description: 'virtual network driver') option('driver_openvz', type: 'feature', value: 'auto', description: 'OpenVZ driver') -# dep:yajl dep:driver_remote dep:driver_libvirtd +# dep:json_c dep:driver_remote dep:driver_libvirtd option('driver_qemu', type: 'feature', value: 'auto', description: 'QEMU/KVM driver') option('qemu_user', type: 'string', value: '', description: 'username to run QEMU system instance as') option('qemu_group', type: 'string', value: '', description: 'groupname to run QEMU system instance as') @@ -123,7 +123,7 @@ option('host_validate', type: 'feature', value: 'auto', description: 'build virt option('init_script', type: 'combo', choices: ['systemd', 'openrc', 'check', 'none'], value: 'check', description: 'Style of init script to install') option('loader_nvram', type: 'string', value: '', description: 'Pass list of pairs of <loader>:<nvram> paths. Both pairs and list items are separated by a colon.') option('login_shell', type: 'feature', value: 'auto', description: 'build virt-login-shell') -# dep:yajl dep:driver_network dep:libvirtd +# dep:json_c dep:driver_network dep:libvirtd option('nss', type: 'feature', value: 'auto', description: 'enable Name Service Switch plugin for resolving guest IP addresses') # dep:numactl option('numad', type: 'feature', value: 'auto', description: 'use numad to manage CPU placement dynamically') -- 2.45.2

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index ad0f4f784f..b9f9f5ed45 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -361,7 +361,7 @@ BuildRequires: libblkid-devel >= 2.17 BuildRequires: augeas BuildRequires: systemd-devel >= 185 BuildRequires: libpciaccess-devel >= 0.10.9 -BuildRequires: yajl-devel +BuildRequires: json-c-devel %if %{with_sanlock} BuildRequires: sanlock-devel >= 2.4 %endif @@ -1369,7 +1369,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dapparmor_profiles=disabled \ -Dsecdriver_apparmor=disabled \ -Dudev=enabled \ - -Dyajl=enabled \ + -Djson_c=enabled \ %{?arg_sanlock} \ -Dlibpcap=enabled \ %{?arg_nbdkit} \ @@ -1484,7 +1484,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dtests=disabled \ -Dudev=disabled \ -Dwireshark_dissector=disabled \ - -Dyajl=disabled \ + -Dyajl=disabled %{?enable_werror} %mingw_ninja %endif -- 2.45.2

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/meson.build | 1 - src/util/meson.build | 1 - tests/meson.build | 1 - tools/nss/meson.build | 2 -- 4 files changed, 5 deletions(-) diff --git a/src/meson.build b/src/meson.build index b9652785dd..b53ea2a71f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -559,7 +559,6 @@ if conf.has('WITH_REMOTE') src_dep, rpc_dep, xdr_dep, - yajl_dep, ], include_directories: [ admin_inc_dir, diff --git a/src/util/meson.build b/src/util/meson.build index ab6942fa81..2998fed920 100644 --- a/src/util/meson.build +++ b/src/util/meson.build @@ -203,7 +203,6 @@ virt_util_lib = static_library( src_dep, thread_dep, win32_dep, - yajl_dep, ], ) diff --git a/tests/meson.build b/tests/meson.build index d6e73bfba0..64e5780e48 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -17,7 +17,6 @@ tests_dep = declare_dependency( sasl_dep, selinux_dep, xdr_dep, - yajl_dep, ], include_directories: [ conf_inc_dir, diff --git a/tools/nss/meson.build b/tools/nss/meson.build index 1cae93ac67..38bba2d616 100644 --- a/tools/nss/meson.build +++ b/tools/nss/meson.build @@ -30,7 +30,6 @@ nss_libvirt_impl = static_library( dependencies: [ json_c_dep, tools_dep, - yajl_dep, ], ) @@ -47,7 +46,6 @@ nss_libvirt_guest_impl = static_library( dependencies: [ json_c_dep, tools_dep, - yajl_dep, ], ) -- 2.45.2

Drop the yajl option and all references to it. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 1 - meson.build | 2 +- meson_options.txt | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index b9f9f5ed45..e0c616627e 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1484,7 +1484,6 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dtests=disabled \ -Dudev=disabled \ -Dwireshark_dissector=disabled \ - -Dyajl=disabled %{?enable_werror} %mingw_ninja %endif diff --git a/meson.build b/meson.build index 837b209232..e8c19d8725 100644 --- a/meson.build +++ b/meson.build @@ -1378,7 +1378,7 @@ if wireshark_dep.found() endif yajl_version = '2.0.3' -yajl_dep = dependency('yajl', version: '>=' + yajl_version, required: get_option('yajl')) +yajl_dep = dependency('yajl', version: '>=' + yajl_version, required: false) if yajl_dep.found() # Kludge for yajl include path on non-Linux # diff --git a/meson_options.txt b/meson_options.txt index 122cda0350..3dc3e8667b 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -51,7 +51,6 @@ option('udev', type: 'feature', value: 'auto', description: 'udev support') # dep:driver_remote option('wireshark_dissector', type: 'feature', value: 'auto', description: 'wireshark support') option('wireshark_plugindir', type: 'string', value: '', description: 'wireshark plugins directory for use when installing wireshark plugin') -option('yajl', type: 'feature', value: 'auto', description: 'yajl support') # build driver options -- 2.45.2

After this commit, WITH_YAJL can no longer be set. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/meson.build b/meson.build index e8c19d8725..503b4362f7 100644 --- a/meson.build +++ b/meson.build @@ -1377,47 +1377,6 @@ if wireshark_dep.found() endif endif -yajl_version = '2.0.3' -yajl_dep = dependency('yajl', version: '>=' + yajl_version, required: false) -if yajl_dep.found() - # Kludge for yajl include path on non-Linux - # - # As of 2.1.0, upstream yajl.pc has -I${includedir}/yajl among - # its Cflags, which is clearly wrong. This does not affect Linux - # because ${includedir} is already part of the default include path, - # but on other platforms that's not the case and the result is that - # <yajl/yajl.h> can't be located, causing the build to fail. - # - # Since upstream development for yajl has stopped years ago, there's - # little hope of this issue getting fixed by a new upstream release. - # Some non-Linux operating systems such as FreeBSD have elected to - # carry a small downstream patch, but in the case of Homebrew on - # macOS this approach has been rejected[1] and so we're left with no - # choice but to work around the issue ourselves. - # - # [1] https://github.com/Homebrew/homebrew-core/pull/74516 - if host_machine.system() != 'linux' - yajl_includedir = yajl_dep.get_variable(pkgconfig : 'includedir') - if yajl_includedir.contains('include/yajl') - rc = run_command( - 'python3', '-c', - 'print("@0@".replace("@1@", "@2@"))'.format( - yajl_includedir, 'include/yajl', 'include', - ), - check: true, - ) - yajl_includedir = rc.stdout().strip() - yajl_dep = declare_dependency( - compile_args: [ '-I' + yajl_includedir ], - dependencies: [ yajl_dep ], - ) - endif - endif - - conf.set('WITH_YAJL', 1) -endif - - # generic build dependencies checks if bash_completion_dep.found() and not readline_dep.found() @@ -2372,7 +2331,6 @@ libs_summary = { 'selinux': selinux_dep.found(), 'udev': udev_dep.found(), 'xdr': xdr_dep.found(), - 'yajl': yajl_dep.found(), } summary(libs_summary, section: 'Libraries', bool_yn: true) -- 2.45.2

Now that WITH_YAJL can never be set, we can remove some more code. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- src/util/virjson.c | 416 --------------------------------------------- 1 file changed, 416 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 7a22c54f03..98011759fb 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -34,10 +34,6 @@ #if WITH_JSON_C # include <json.h> -#elif WITH_YAJL -# include <yajl/yajl_gen.h> -# include <yajl/yajl_parse.h> - #endif /* XXX fixme */ @@ -1563,418 +1559,6 @@ virJSONValueToBuffer(virJSONValue *object, return ret; } -#elif WITH_YAJL -static int -virJSONParserInsertValue(virJSONParser *parser, - virJSONValue **value) -{ - if (!parser->head) { - parser->head = g_steal_pointer(value); - } else { - virJSONParserState *state; - if (!parser->nstate) { - VIR_DEBUG("got a value to insert without a container"); - return -1; - } - - state = &parser->state[parser->nstate-1]; - - switch (state->value->type) { - case VIR_JSON_TYPE_OBJECT: { - if (!state->key) { - VIR_DEBUG("missing key when inserting object value"); - return -1; - } - - if (virJSONValueObjectAppend(state->value, - state->key, - value) < 0) - return -1; - - VIR_FREE(state->key); - } break; - - case VIR_JSON_TYPE_ARRAY: { - if (state->key) { - VIR_DEBUG("unexpected key when inserting array value"); - return -1; - } - - if (virJSONValueArrayAppend(state->value, - value) < 0) - return -1; - } break; - - default: - VIR_DEBUG("unexpected value type, not a container"); - return -1; - } - } - - return 0; -} - - -static int -virJSONParserHandleNull(void *ctx) -{ - virJSONParser *parser = ctx; - g_autoptr(virJSONValue) value = virJSONValueNewNull(); - - VIR_DEBUG("parser=%p", parser); - - if (virJSONParserInsertValue(parser, &value) < 0) - return 0; - - return 1; -} - - -static int -virJSONParserHandleBoolean(void *ctx, - int boolean_) -{ - virJSONParser *parser = ctx; - g_autoptr(virJSONValue) value = virJSONValueNewBoolean(boolean_); - - VIR_DEBUG("parser=%p boolean=%d", parser, boolean_); - - if (virJSONParserInsertValue(parser, &value) < 0) - return 0; - - return 1; -} - - -static int -virJSONParserHandleNumber(void *ctx, - const char *s, - size_t l) -{ - virJSONParser *parser = ctx; - g_autoptr(virJSONValue) value = virJSONValueNewNumber(g_strndup(s, l)); - - VIR_DEBUG("parser=%p str=%s", parser, value->data.number); - - if (virJSONParserInsertValue(parser, &value) < 0) - return 0; - - return 1; -} - - -static int -virJSONParserHandleString(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - virJSONParser *parser = ctx; - g_autoptr(virJSONValue) value = virJSONValueNewString(g_strndup((const char *)stringVal, stringLen)); - - VIR_DEBUG("parser=%p str=%p", parser, (const char *)stringVal); - - if (virJSONParserInsertValue(parser, &value) < 0) - return 0; - - return 1; -} - - -static int -virJSONParserHandleMapKey(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - virJSONParser *parser = ctx; - virJSONParserState *state; - - VIR_DEBUG("parser=%p key=%p", parser, (const char *)stringVal); - - if (!parser->nstate) - return 0; - - state = &parser->state[parser->nstate-1]; - if (state->key) - return 0; - state->key = g_strndup((const char *)stringVal, stringLen); - return 1; -} - - -static int -virJSONParserHandleStartMap(void *ctx) -{ - virJSONParser *parser = ctx; - g_autoptr(virJSONValue) value = virJSONValueNewObject(); - virJSONValue *tmp = value; - - VIR_DEBUG("parser=%p", parser); - - if (virJSONParserInsertValue(parser, &value) < 0) - return 0; - - VIR_REALLOC_N(parser->state, parser->nstate + 1); - - parser->state[parser->nstate].value = tmp; - parser->state[parser->nstate].key = NULL; - parser->nstate++; - - return 1; -} - - -static int -virJSONParserHandleEndMap(void *ctx) -{ - virJSONParser *parser = ctx; - virJSONParserState *state; - - VIR_DEBUG("parser=%p", parser); - - if (!parser->nstate) - return 0; - - state = &(parser->state[parser->nstate-1]); - if (state->key) { - VIR_FREE(state->key); - return 0; - } - - VIR_DELETE_ELEMENT(parser->state, parser->nstate - 1, parser->nstate); - - return 1; -} - - -static int -virJSONParserHandleStartArray(void *ctx) -{ - virJSONParser *parser = ctx; - g_autoptr(virJSONValue) value = virJSONValueNewArray(); - virJSONValue *tmp = value; - - VIR_DEBUG("parser=%p", parser); - - if (virJSONParserInsertValue(parser, &value) < 0) - return 0; - - VIR_REALLOC_N(parser->state, parser->nstate + 1); - - parser->state[parser->nstate].value = tmp; - parser->state[parser->nstate].key = NULL; - parser->nstate++; - - return 1; -} - - -static int -virJSONParserHandleEndArray(void *ctx) -{ - virJSONParser *parser = ctx; - virJSONParserState *state; - - VIR_DEBUG("parser=%p", parser); - - if (!(parser->nstate - parser->wrap)) - return 0; - - state = &(parser->state[parser->nstate-1]); - if (state->key) { - VIR_FREE(state->key); - return 0; - } - - VIR_DELETE_ELEMENT(parser->state, parser->nstate - 1, parser->nstate); - - return 1; -} - - -static const yajl_callbacks parserCallbacks = { - virJSONParserHandleNull, - virJSONParserHandleBoolean, - NULL, - NULL, - virJSONParserHandleNumber, - virJSONParserHandleString, - virJSONParserHandleStartMap, - virJSONParserHandleMapKey, - virJSONParserHandleEndMap, - virJSONParserHandleStartArray, - virJSONParserHandleEndArray -}; - - -/* XXX add an incremental streaming parser - yajl trivially supports it */ -virJSONValue * -virJSONValueFromString(const char *jsonstring) -{ - yajl_handle hand; - virJSONParser parser = { NULL, NULL, 0, 0 }; - virJSONValue *ret = NULL; - int rc; - size_t len = strlen(jsonstring); - - VIR_DEBUG("string=%s", jsonstring); - - hand = yajl_alloc(&parserCallbacks, NULL, &parser); - if (!hand) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to create JSON parser")); - return NULL; - } - - /* Yajl 2 is nice enough to default to rejecting trailing garbage. */ - rc = yajl_parse(hand, (const unsigned char *)jsonstring, len); - if (rc != yajl_status_ok || - yajl_complete_parse(hand) != yajl_status_ok) { - unsigned char *errstr = yajl_get_error(hand, 1, - (const unsigned char*)jsonstring, - strlen(jsonstring)); - - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse json %1$s: %2$s"), - jsonstring, (const char*) errstr); - yajl_free_error(hand, errstr); - virJSONValueFree(parser.head); - goto cleanup; - } - - if (parser.nstate != 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("cannot parse json %1$s: unterminated string/map/array"), - jsonstring); - virJSONValueFree(parser.head); - } else { - ret = parser.head; - } - - cleanup: - yajl_free(hand); - - if (parser.nstate) { - size_t i; - for (i = 0; i < parser.nstate; i++) - VIR_FREE(parser.state[i].key); - VIR_FREE(parser.state); - } - - VIR_DEBUG("result=%p", ret); - - return ret; -} - - -static int -virJSONValueToStringOne(virJSONValue *object, - yajl_gen g) -{ - size_t i; - - VIR_DEBUG("object=%p type=%d gen=%p", object, object->type, g); - - switch (object->type) { - case VIR_JSON_TYPE_OBJECT: - if (yajl_gen_map_open(g) != yajl_gen_status_ok) - return -1; - for (i = 0; i < object->data.object.npairs; i++) { - if (yajl_gen_string(g, - (unsigned char *)object->data.object.pairs[i].key, - strlen(object->data.object.pairs[i].key)) - != yajl_gen_status_ok) - return -1; - if (virJSONValueToStringOne(object->data.object.pairs[i].value, g) < 0) - return -1; - } - if (yajl_gen_map_close(g) != yajl_gen_status_ok) - return -1; - break; - case VIR_JSON_TYPE_ARRAY: - if (yajl_gen_array_open(g) != yajl_gen_status_ok) - return -1; - for (i = 0; i < object->data.array.nvalues; i++) { - if (virJSONValueToStringOne(object->data.array.values[i], g) < 0) - return -1; - } - if (yajl_gen_array_close(g) != yajl_gen_status_ok) - return -1; - break; - - case VIR_JSON_TYPE_STRING: - if (yajl_gen_string(g, (unsigned char *)object->data.string, - strlen(object->data.string)) != yajl_gen_status_ok) - return -1; - break; - - case VIR_JSON_TYPE_NUMBER: - if (yajl_gen_number(g, object->data.number, - strlen(object->data.number)) != yajl_gen_status_ok) - return -1; - break; - - case VIR_JSON_TYPE_BOOLEAN: - if (yajl_gen_bool(g, object->data.boolean) != yajl_gen_status_ok) - return -1; - break; - - case VIR_JSON_TYPE_NULL: - if (yajl_gen_null(g) != yajl_gen_status_ok) - return -1; - break; - - default: - return -1; - } - - return 0; -} - - -int -virJSONValueToBuffer(virJSONValue *object, - virBuffer *buf, - bool pretty) -{ - yajl_gen g; - const unsigned char *str; - size_t len; - int ret = -1; - - VIR_DEBUG("object=%p", object); - - g = yajl_gen_alloc(NULL); - if (!g) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to create JSON formatter")); - goto cleanup; - } - yajl_gen_config(g, yajl_gen_beautify, pretty ? 1 : 0); - yajl_gen_config(g, yajl_gen_indent_string, pretty ? " " : " "); - yajl_gen_config(g, yajl_gen_validate_utf8, 1); - - if (virJSONValueToStringOne(object, g) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to convert virJSONValue to yajl data")); - goto cleanup; - } - - if (yajl_gen_get_buf(g, &str, &len) != yajl_gen_status_ok) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("failed to format JSON")); - goto cleanup; - } - - virBufferAdd(buf, (const char *) str, len); - ret = 0; - - cleanup: - yajl_gen_free(g); - - return ret; -} - - #else virJSONValue * virJSONValueFromString(const char *jsonstring G_GNUC_UNUSED) -- 2.45.2

It is no longer used by libvirt so it's pointless to install it. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- ci/buildenv/almalinux-9.sh | 3 +-- ci/buildenv/alpine-319.sh | 3 +-- ci/buildenv/alpine-edge.sh | 3 +-- ci/buildenv/centos-stream-9.sh | 3 +-- ci/buildenv/debian-11-cross-aarch64.sh | 1 - ci/buildenv/debian-11-cross-armv6l.sh | 1 - ci/buildenv/debian-11-cross-armv7l.sh | 1 - ci/buildenv/debian-11-cross-i686.sh | 1 - ci/buildenv/debian-11-cross-mips64el.sh | 1 - ci/buildenv/debian-11-cross-mipsel.sh | 1 - ci/buildenv/debian-11-cross-ppc64le.sh | 1 - ci/buildenv/debian-11-cross-s390x.sh | 1 - ci/buildenv/debian-11.sh | 1 - ci/buildenv/debian-12-cross-aarch64.sh | 1 - ci/buildenv/debian-12-cross-armv6l.sh | 1 - ci/buildenv/debian-12-cross-armv7l.sh | 1 - ci/buildenv/debian-12-cross-i686.sh | 1 - ci/buildenv/debian-12-cross-mips64el.sh | 1 - ci/buildenv/debian-12-cross-mipsel.sh | 1 - ci/buildenv/debian-12-cross-ppc64le.sh | 1 - ci/buildenv/debian-12-cross-s390x.sh | 1 - ci/buildenv/debian-12.sh | 1 - ci/buildenv/debian-sid-cross-aarch64.sh | 1 - ci/buildenv/debian-sid-cross-armv6l.sh | 1 - ci/buildenv/debian-sid-cross-armv7l.sh | 1 - ci/buildenv/debian-sid-cross-i686.sh | 1 - ci/buildenv/debian-sid-cross-mips64el.sh | 1 - ci/buildenv/debian-sid-cross-ppc64le.sh | 1 - ci/buildenv/debian-sid-cross-s390x.sh | 1 - ci/buildenv/debian-sid.sh | 1 - ci/buildenv/fedora-39.sh | 3 +-- ci/buildenv/fedora-40.sh | 3 +-- ci/buildenv/fedora-rawhide.sh | 3 +-- ci/buildenv/opensuse-leap-15.sh | 1 - ci/buildenv/opensuse-tumbleweed.sh | 1 - ci/buildenv/ubuntu-2204.sh | 1 - ci/buildenv/ubuntu-2404.sh | 1 - ci/cirrus/freebsd-13.vars | 2 +- ci/cirrus/freebsd-14.vars | 2 +- ci/cirrus/macos-13.vars | 2 +- ci/cirrus/macos-14.vars | 2 +- ci/containers/almalinux-9.Dockerfile | 3 +-- ci/containers/alpine-319.Dockerfile | 3 +-- ci/containers/alpine-edge.Dockerfile | 3 +-- ci/containers/centos-stream-9.Dockerfile | 3 +-- ci/containers/debian-11-cross-aarch64.Dockerfile | 1 - ci/containers/debian-11-cross-armv6l.Dockerfile | 1 - ci/containers/debian-11-cross-armv7l.Dockerfile | 1 - ci/containers/debian-11-cross-i686.Dockerfile | 1 - ci/containers/debian-11-cross-mips64el.Dockerfile | 1 - ci/containers/debian-11-cross-mipsel.Dockerfile | 1 - ci/containers/debian-11-cross-ppc64le.Dockerfile | 1 - ci/containers/debian-11-cross-s390x.Dockerfile | 1 - ci/containers/debian-11.Dockerfile | 1 - ci/containers/debian-12-cross-aarch64.Dockerfile | 1 - ci/containers/debian-12-cross-armv6l.Dockerfile | 1 - ci/containers/debian-12-cross-armv7l.Dockerfile | 1 - ci/containers/debian-12-cross-i686.Dockerfile | 1 - ci/containers/debian-12-cross-mips64el.Dockerfile | 1 - ci/containers/debian-12-cross-mipsel.Dockerfile | 1 - ci/containers/debian-12-cross-ppc64le.Dockerfile | 1 - ci/containers/debian-12-cross-s390x.Dockerfile | 1 - ci/containers/debian-12.Dockerfile | 1 - ci/containers/debian-sid-cross-aarch64.Dockerfile | 1 - ci/containers/debian-sid-cross-armv6l.Dockerfile | 1 - ci/containers/debian-sid-cross-armv7l.Dockerfile | 1 - ci/containers/debian-sid-cross-i686.Dockerfile | 1 - ci/containers/debian-sid-cross-mips64el.Dockerfile | 1 - ci/containers/debian-sid-cross-ppc64le.Dockerfile | 1 - ci/containers/debian-sid-cross-s390x.Dockerfile | 1 - ci/containers/debian-sid.Dockerfile | 1 - ci/containers/fedora-39.Dockerfile | 3 +-- ci/containers/fedora-40.Dockerfile | 3 +-- ci/containers/fedora-rawhide.Dockerfile | 3 +-- ci/containers/opensuse-leap-15.Dockerfile | 1 - ci/containers/opensuse-tumbleweed.Dockerfile | 1 - ci/containers/ubuntu-2204.Dockerfile | 1 - ci/containers/ubuntu-2404.Dockerfile | 1 - ci/lcitool/projects/libvirt.yml | 1 - 79 files changed, 18 insertions(+), 93 deletions(-) diff --git a/ci/buildenv/almalinux-9.sh b/ci/buildenv/almalinux-9.sh index 6ca05b4add..3f3993229e 100644 --- a/ci/buildenv/almalinux-9.sh +++ b/ci/buildenv/almalinux-9.sh @@ -84,8 +84,7 @@ function install_buildenv() { systemd-devel \ systemd-rpm-macros \ systemtap-sdt-devel \ - wireshark-devel \ - yajl-devel + wireshark-devel rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED rpm -qa | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/alpine-319.sh b/ci/buildenv/alpine-319.sh index fe8dcf8ab7..d2149a6def 100644 --- a/ci/buildenv/alpine-319.sh +++ b/ci/buildenv/alpine-319.sh @@ -67,8 +67,7 @@ function install_buildenv() { sed \ util-linux-dev \ wireshark-dev \ - xen-dev \ - yajl-dev + xen-dev rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED apk list --installed | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/alpine-edge.sh b/ci/buildenv/alpine-edge.sh index fe8dcf8ab7..d2149a6def 100644 --- a/ci/buildenv/alpine-edge.sh +++ b/ci/buildenv/alpine-edge.sh @@ -67,8 +67,7 @@ function install_buildenv() { sed \ util-linux-dev \ wireshark-dev \ - xen-dev \ - yajl-dev + xen-dev rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED apk list --installed | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/centos-stream-9.sh b/ci/buildenv/centos-stream-9.sh index ca5bce3eb9..cb67c3cdcc 100644 --- a/ci/buildenv/centos-stream-9.sh +++ b/ci/buildenv/centos-stream-9.sh @@ -85,8 +85,7 @@ function install_buildenv() { systemd-devel \ systemd-rpm-macros \ systemtap-sdt-devel \ - wireshark-devel \ - yajl-devel + wireshark-devel rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED rpm -qa | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/debian-11-cross-aarch64.sh b/ci/buildenv/debian-11-cross-aarch64.sh index 2d9ad9064d..6600b73e74 100644 --- a/ci/buildenv/debian-11-cross-aarch64.sh +++ b/ci/buildenv/debian-11-cross-aarch64.sh @@ -88,7 +88,6 @@ function install_buildenv() { libudev-dev:arm64 \ libxen-dev:arm64 \ libxml2-dev:arm64 \ - libyajl-dev:arm64 \ systemtap-sdt-dev:arm64 mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-armv6l.sh b/ci/buildenv/debian-11-cross-armv6l.sh index 2be50a66c9..761d813df0 100644 --- a/ci/buildenv/debian-11-cross-armv6l.sh +++ b/ci/buildenv/debian-11-cross-armv6l.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:armel \ libudev-dev:armel \ libxml2-dev:armel \ - libyajl-dev:armel \ systemtap-sdt-dev:armel mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-armv7l.sh b/ci/buildenv/debian-11-cross-armv7l.sh index 6d6ef91868..6c016bd90b 100644 --- a/ci/buildenv/debian-11-cross-armv7l.sh +++ b/ci/buildenv/debian-11-cross-armv7l.sh @@ -88,7 +88,6 @@ function install_buildenv() { libudev-dev:armhf \ libxen-dev:armhf \ libxml2-dev:armhf \ - libyajl-dev:armhf \ systemtap-sdt-dev:armhf mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-i686.sh b/ci/buildenv/debian-11-cross-i686.sh index b8bd49e3a8..b9705f1c3c 100644 --- a/ci/buildenv/debian-11-cross-i686.sh +++ b/ci/buildenv/debian-11-cross-i686.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:i386 \ libudev-dev:i386 \ libxml2-dev:i386 \ - libyajl-dev:i386 \ systemtap-sdt-dev:i386 mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-mips64el.sh b/ci/buildenv/debian-11-cross-mips64el.sh index 3d5b75139c..065c61ba57 100644 --- a/ci/buildenv/debian-11-cross-mips64el.sh +++ b/ci/buildenv/debian-11-cross-mips64el.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:mips64el \ libudev-dev:mips64el \ libxml2-dev:mips64el \ - libyajl-dev:mips64el \ systemtap-sdt-dev:mips64el mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-mipsel.sh b/ci/buildenv/debian-11-cross-mipsel.sh index 20a97c165e..89a0a8904b 100644 --- a/ci/buildenv/debian-11-cross-mipsel.sh +++ b/ci/buildenv/debian-11-cross-mipsel.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:mipsel \ libudev-dev:mipsel \ libxml2-dev:mipsel \ - libyajl-dev:mipsel \ systemtap-sdt-dev:mipsel mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-ppc64le.sh b/ci/buildenv/debian-11-cross-ppc64le.sh index 2b5ebf360d..c898939f09 100644 --- a/ci/buildenv/debian-11-cross-ppc64le.sh +++ b/ci/buildenv/debian-11-cross-ppc64le.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:ppc64el \ libudev-dev:ppc64el \ libxml2-dev:ppc64el \ - libyajl-dev:ppc64el \ systemtap-sdt-dev:ppc64el mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11-cross-s390x.sh b/ci/buildenv/debian-11-cross-s390x.sh index 1391685e46..f1b94ac872 100644 --- a/ci/buildenv/debian-11-cross-s390x.sh +++ b/ci/buildenv/debian-11-cross-s390x.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:s390x \ libudev-dev:s390x \ libxml2-dev:s390x \ - libyajl-dev:s390x \ systemtap-sdt-dev:s390x mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-11.sh b/ci/buildenv/debian-11.sh index e56ea3b3ec..9ba9e80183 100644 --- a/ci/buildenv/debian-11.sh +++ b/ci/buildenv/debian-11.sh @@ -64,7 +64,6 @@ function install_buildenv() { libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/buildenv/debian-12-cross-aarch64.sh b/ci/buildenv/debian-12-cross-aarch64.sh index 4f7285e171..93288ae46f 100644 --- a/ci/buildenv/debian-12-cross-aarch64.sh +++ b/ci/buildenv/debian-12-cross-aarch64.sh @@ -89,7 +89,6 @@ function install_buildenv() { libudev-dev:arm64 \ libxen-dev:arm64 \ libxml2-dev:arm64 \ - libyajl-dev:arm64 \ systemtap-sdt-dev:arm64 mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-armv6l.sh b/ci/buildenv/debian-12-cross-armv6l.sh index 6d98d1deff..37e743478d 100644 --- a/ci/buildenv/debian-12-cross-armv6l.sh +++ b/ci/buildenv/debian-12-cross-armv6l.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:armel \ libudev-dev:armel \ libxml2-dev:armel \ - libyajl-dev:armel \ systemtap-sdt-dev:armel mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-armv7l.sh b/ci/buildenv/debian-12-cross-armv7l.sh index 39d064b659..1b8e4f7019 100644 --- a/ci/buildenv/debian-12-cross-armv7l.sh +++ b/ci/buildenv/debian-12-cross-armv7l.sh @@ -89,7 +89,6 @@ function install_buildenv() { libudev-dev:armhf \ libxen-dev:armhf \ libxml2-dev:armhf \ - libyajl-dev:armhf \ systemtap-sdt-dev:armhf mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-i686.sh b/ci/buildenv/debian-12-cross-i686.sh index aa91d6e08a..060b6ea75e 100644 --- a/ci/buildenv/debian-12-cross-i686.sh +++ b/ci/buildenv/debian-12-cross-i686.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:i386 \ libudev-dev:i386 \ libxml2-dev:i386 \ - libyajl-dev:i386 \ systemtap-sdt-dev:i386 mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-mips64el.sh b/ci/buildenv/debian-12-cross-mips64el.sh index e3b92bf9db..6da5920d1d 100644 --- a/ci/buildenv/debian-12-cross-mips64el.sh +++ b/ci/buildenv/debian-12-cross-mips64el.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:mips64el \ libudev-dev:mips64el \ libxml2-dev:mips64el \ - libyajl-dev:mips64el \ systemtap-sdt-dev:mips64el mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-mipsel.sh b/ci/buildenv/debian-12-cross-mipsel.sh index 7c5de342a4..5ad809c625 100644 --- a/ci/buildenv/debian-12-cross-mipsel.sh +++ b/ci/buildenv/debian-12-cross-mipsel.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:mipsel \ libudev-dev:mipsel \ libxml2-dev:mipsel \ - libyajl-dev:mipsel \ systemtap-sdt-dev:mipsel mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-ppc64le.sh b/ci/buildenv/debian-12-cross-ppc64le.sh index 05f2a2bd54..eca66706fc 100644 --- a/ci/buildenv/debian-12-cross-ppc64le.sh +++ b/ci/buildenv/debian-12-cross-ppc64le.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:ppc64el \ libudev-dev:ppc64el \ libxml2-dev:ppc64el \ - libyajl-dev:ppc64el \ systemtap-sdt-dev:ppc64el mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12-cross-s390x.sh b/ci/buildenv/debian-12-cross-s390x.sh index b092d59b9d..65dc4ce545 100644 --- a/ci/buildenv/debian-12-cross-s390x.sh +++ b/ci/buildenv/debian-12-cross-s390x.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:s390x \ libudev-dev:s390x \ libxml2-dev:s390x \ - libyajl-dev:s390x \ systemtap-sdt-dev:s390x mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-12.sh b/ci/buildenv/debian-12.sh index 01777c2165..d06f33af12 100644 --- a/ci/buildenv/debian-12.sh +++ b/ci/buildenv/debian-12.sh @@ -64,7 +64,6 @@ function install_buildenv() { libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/buildenv/debian-sid-cross-aarch64.sh b/ci/buildenv/debian-sid-cross-aarch64.sh index 4f7285e171..93288ae46f 100644 --- a/ci/buildenv/debian-sid-cross-aarch64.sh +++ b/ci/buildenv/debian-sid-cross-aarch64.sh @@ -89,7 +89,6 @@ function install_buildenv() { libudev-dev:arm64 \ libxen-dev:arm64 \ libxml2-dev:arm64 \ - libyajl-dev:arm64 \ systemtap-sdt-dev:arm64 mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid-cross-armv6l.sh b/ci/buildenv/debian-sid-cross-armv6l.sh index c5ced00879..f19ec82093 100644 --- a/ci/buildenv/debian-sid-cross-armv6l.sh +++ b/ci/buildenv/debian-sid-cross-armv6l.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:armel \ libudev-dev:armel \ libxml2-dev:armel \ - libyajl-dev:armel \ systemtap-sdt-dev:armel mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid-cross-armv7l.sh b/ci/buildenv/debian-sid-cross-armv7l.sh index 38c3dffe1a..4ebf3126e3 100644 --- a/ci/buildenv/debian-sid-cross-armv7l.sh +++ b/ci/buildenv/debian-sid-cross-armv7l.sh @@ -88,7 +88,6 @@ function install_buildenv() { libudev-dev:armhf \ libxen-dev:armhf \ libxml2-dev:armhf \ - libyajl-dev:armhf \ systemtap-sdt-dev:armhf mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid-cross-i686.sh b/ci/buildenv/debian-sid-cross-i686.sh index 59694cca46..43c02e784e 100644 --- a/ci/buildenv/debian-sid-cross-i686.sh +++ b/ci/buildenv/debian-sid-cross-i686.sh @@ -87,7 +87,6 @@ function install_buildenv() { libtirpc-dev:i386 \ libudev-dev:i386 \ libxml2-dev:i386 \ - libyajl-dev:i386 \ systemtap-sdt-dev:i386 mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid-cross-mips64el.sh b/ci/buildenv/debian-sid-cross-mips64el.sh index e3b92bf9db..6da5920d1d 100644 --- a/ci/buildenv/debian-sid-cross-mips64el.sh +++ b/ci/buildenv/debian-sid-cross-mips64el.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:mips64el \ libudev-dev:mips64el \ libxml2-dev:mips64el \ - libyajl-dev:mips64el \ systemtap-sdt-dev:mips64el mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid-cross-ppc64le.sh b/ci/buildenv/debian-sid-cross-ppc64le.sh index 05f2a2bd54..eca66706fc 100644 --- a/ci/buildenv/debian-sid-cross-ppc64le.sh +++ b/ci/buildenv/debian-sid-cross-ppc64le.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:ppc64el \ libudev-dev:ppc64el \ libxml2-dev:ppc64el \ - libyajl-dev:ppc64el \ systemtap-sdt-dev:ppc64el mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid-cross-s390x.sh b/ci/buildenv/debian-sid-cross-s390x.sh index b092d59b9d..65dc4ce545 100644 --- a/ci/buildenv/debian-sid-cross-s390x.sh +++ b/ci/buildenv/debian-sid-cross-s390x.sh @@ -88,7 +88,6 @@ function install_buildenv() { libtirpc-dev:s390x \ libudev-dev:s390x \ libxml2-dev:s390x \ - libyajl-dev:s390x \ systemtap-sdt-dev:s390x mkdir -p /usr/local/share/meson/cross printf "[binaries]\n\ diff --git a/ci/buildenv/debian-sid.sh b/ci/buildenv/debian-sid.sh index 01777c2165..d06f33af12 100644 --- a/ci/buildenv/debian-sid.sh +++ b/ci/buildenv/debian-sid.sh @@ -64,7 +64,6 @@ function install_buildenv() { libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/buildenv/fedora-39.sh b/ci/buildenv/fedora-39.sh index 06ae3bb62d..e45ac2230f 100644 --- a/ci/buildenv/fedora-39.sh +++ b/ci/buildenv/fedora-39.sh @@ -83,8 +83,7 @@ function install_buildenv() { systemd-rpm-macros \ systemtap-sdt-devel \ wireshark-devel \ - xen-devel \ - yajl-devel + xen-devel rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED rpm -qa | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/fedora-40.sh b/ci/buildenv/fedora-40.sh index 06ae3bb62d..e45ac2230f 100644 --- a/ci/buildenv/fedora-40.sh +++ b/ci/buildenv/fedora-40.sh @@ -83,8 +83,7 @@ function install_buildenv() { systemd-rpm-macros \ systemtap-sdt-devel \ wireshark-devel \ - xen-devel \ - yajl-devel + xen-devel rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED rpm -qa | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/fedora-rawhide.sh b/ci/buildenv/fedora-rawhide.sh index aec2d87b53..cbfeb71c92 100644 --- a/ci/buildenv/fedora-rawhide.sh +++ b/ci/buildenv/fedora-rawhide.sh @@ -84,8 +84,7 @@ function install_buildenv() { systemd-rpm-macros \ systemtap-sdt-devel \ wireshark-devel \ - xen-devel \ - yajl-devel + xen-devel rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED rpm -qa | sort > /packages.txt mkdir -p /usr/libexec/ccache-wrappers diff --git a/ci/buildenv/opensuse-leap-15.sh b/ci/buildenv/opensuse-leap-15.sh index d462e6cdce..2a1c1e2314 100644 --- a/ci/buildenv/opensuse-leap-15.sh +++ b/ci/buildenv/opensuse-leap-15.sh @@ -59,7 +59,6 @@ function install_buildenv() { libxml2 \ libxml2-devel \ libxslt \ - libyajl-devel \ lvm2 \ make \ meson \ diff --git a/ci/buildenv/opensuse-tumbleweed.sh b/ci/buildenv/opensuse-tumbleweed.sh index 2233699719..4e0f812622 100644 --- a/ci/buildenv/opensuse-tumbleweed.sh +++ b/ci/buildenv/opensuse-tumbleweed.sh @@ -59,7 +59,6 @@ function install_buildenv() { libxml2 \ libxml2-devel \ libxslt \ - libyajl-devel \ lvm2 \ make \ meson \ diff --git a/ci/buildenv/ubuntu-2204.sh b/ci/buildenv/ubuntu-2204.sh index e747a6f8c2..95762d663c 100644 --- a/ci/buildenv/ubuntu-2204.sh +++ b/ci/buildenv/ubuntu-2204.sh @@ -65,7 +65,6 @@ function install_buildenv() { libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/buildenv/ubuntu-2404.sh b/ci/buildenv/ubuntu-2404.sh index c26a80d06f..5ce8e74a91 100644 --- a/ci/buildenv/ubuntu-2404.sh +++ b/ci/buildenv/ubuntu-2404.sh @@ -65,7 +65,6 @@ function install_buildenv() { libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/cirrus/freebsd-13.vars b/ci/cirrus/freebsd-13.vars index bf82ac5176..fbcd613095 100644 --- a/ci/cirrus/freebsd-13.vars +++ b/ci/cirrus/freebsd-13.vars @@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline yajl' +PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline' PYPI_PKGS='' PYTHON='/usr/local/bin/python3' diff --git a/ci/cirrus/freebsd-14.vars b/ci/cirrus/freebsd-14.vars index bf82ac5176..fbcd613095 100644 --- a/ci/cirrus/freebsd-14.vars +++ b/ci/cirrus/freebsd-14.vars @@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PACKAGING_COMMAND='pkg' PIP3='/usr/local/bin/pip-3.8' -PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline yajl' +PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils fusefs-libs gettext git glib gmake gnugrep gnutls gsed json-c libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py311-black py311-docutils py311-flake8 py311-pytest python3 qemu readline' PYPI_PKGS='' PYTHON='/usr/local/bin/python3' diff --git a/ci/cirrus/macos-13.vars b/ci/cirrus/macos-13.vars index 9860033931..d23fe3cd47 100644 --- a/ci/cirrus/macos-13.vars +++ b/ci/cirrus/macos-13.vars @@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake' NINJA='/opt/homebrew/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/opt/homebrew/bin/pip3' -PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep json-c libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline yajl' +PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep json-c libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline' PYPI_PKGS='pytest' PYTHON='/opt/homebrew/bin/python3' diff --git a/ci/cirrus/macos-14.vars b/ci/cirrus/macos-14.vars index 9860033931..d23fe3cd47 100644 --- a/ci/cirrus/macos-14.vars +++ b/ci/cirrus/macos-14.vars @@ -11,6 +11,6 @@ MAKE='/opt/homebrew/bin/gmake' NINJA='/opt/homebrew/bin/ninja' PACKAGING_COMMAND='brew' PIP3='/opt/homebrew/bin/pip3' -PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep json-c libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline yajl' +PKGS='augeas bash-completion black ccache codespell cppi curl diffutils docutils flake8 gettext git glib gnu-sed gnutls grep json-c libiscsi libpcap libssh libssh2 libxml2 libxslt make meson ninja perl pkg-config python3 qemu readline' PYPI_PKGS='pytest' PYTHON='/opt/homebrew/bin/python3' diff --git a/ci/containers/almalinux-9.Dockerfile b/ci/containers/almalinux-9.Dockerfile index 0f54cb3224..576119542d 100644 --- a/ci/containers/almalinux-9.Dockerfile +++ b/ci/containers/almalinux-9.Dockerfile @@ -85,8 +85,7 @@ RUN dnf update -y && \ systemd-devel \ systemd-rpm-macros \ systemtap-sdt-devel \ - wireshark-devel \ - yajl-devel && \ + wireshark-devel && \ dnf autoremove -y && \ dnf clean all -y && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ diff --git a/ci/containers/alpine-319.Dockerfile b/ci/containers/alpine-319.Dockerfile index cdd9845a19..2e4842ef3e 100644 --- a/ci/containers/alpine-319.Dockerfile +++ b/ci/containers/alpine-319.Dockerfile @@ -68,8 +68,7 @@ RUN apk update && \ sed \ util-linux-dev \ wireshark-dev \ - xen-dev \ - yajl-dev && \ + xen-dev && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ apk list --installed | sort > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ diff --git a/ci/containers/alpine-edge.Dockerfile b/ci/containers/alpine-edge.Dockerfile index 4790d9ae8a..83f160257f 100644 --- a/ci/containers/alpine-edge.Dockerfile +++ b/ci/containers/alpine-edge.Dockerfile @@ -68,8 +68,7 @@ RUN apk update && \ sed \ util-linux-dev \ wireshark-dev \ - xen-dev \ - yajl-dev && \ + xen-dev && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ apk list --installed | sort > /packages.txt && \ mkdir -p /usr/libexec/ccache-wrappers && \ diff --git a/ci/containers/centos-stream-9.Dockerfile b/ci/containers/centos-stream-9.Dockerfile index d83ca27b93..1b21f9ea75 100644 --- a/ci/containers/centos-stream-9.Dockerfile +++ b/ci/containers/centos-stream-9.Dockerfile @@ -86,8 +86,7 @@ RUN dnf distro-sync -y && \ systemd-devel \ systemd-rpm-macros \ systemtap-sdt-devel \ - wireshark-devel \ - yajl-devel && \ + wireshark-devel && \ dnf autoremove -y && \ dnf clean all -y && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ diff --git a/ci/containers/debian-11-cross-aarch64.Dockerfile b/ci/containers/debian-11-cross-aarch64.Dockerfile index 7a7d22b766..f8d4ea8ed2 100644 --- a/ci/containers/debian-11-cross-aarch64.Dockerfile +++ b/ci/containers/debian-11-cross-aarch64.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libudev-dev:arm64 \ libxen-dev:arm64 \ libxml2-dev:arm64 \ - libyajl-dev:arm64 \ systemtap-sdt-dev:arm64 && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-armv6l.Dockerfile b/ci/containers/debian-11-cross-armv6l.Dockerfile index 08737bb216..f974163000 100644 --- a/ci/containers/debian-11-cross-armv6l.Dockerfile +++ b/ci/containers/debian-11-cross-armv6l.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:armel \ libudev-dev:armel \ libxml2-dev:armel \ - libyajl-dev:armel \ systemtap-sdt-dev:armel && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-armv7l.Dockerfile b/ci/containers/debian-11-cross-armv7l.Dockerfile index d8bb30d4a1..ced175c7c0 100644 --- a/ci/containers/debian-11-cross-armv7l.Dockerfile +++ b/ci/containers/debian-11-cross-armv7l.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libudev-dev:armhf \ libxen-dev:armhf \ libxml2-dev:armhf \ - libyajl-dev:armhf \ systemtap-sdt-dev:armhf && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-i686.Dockerfile b/ci/containers/debian-11-cross-i686.Dockerfile index c37a7d2bfa..c1ee60f3b6 100644 --- a/ci/containers/debian-11-cross-i686.Dockerfile +++ b/ci/containers/debian-11-cross-i686.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:i386 \ libudev-dev:i386 \ libxml2-dev:i386 \ - libyajl-dev:i386 \ systemtap-sdt-dev:i386 && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-mips64el.Dockerfile b/ci/containers/debian-11-cross-mips64el.Dockerfile index 27556d7e07..98c40beef4 100644 --- a/ci/containers/debian-11-cross-mips64el.Dockerfile +++ b/ci/containers/debian-11-cross-mips64el.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:mips64el \ libudev-dev:mips64el \ libxml2-dev:mips64el \ - libyajl-dev:mips64el \ systemtap-sdt-dev:mips64el && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-mipsel.Dockerfile b/ci/containers/debian-11-cross-mipsel.Dockerfile index be0e9e0188..e3531a9fac 100644 --- a/ci/containers/debian-11-cross-mipsel.Dockerfile +++ b/ci/containers/debian-11-cross-mipsel.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:mipsel \ libudev-dev:mipsel \ libxml2-dev:mipsel \ - libyajl-dev:mipsel \ systemtap-sdt-dev:mipsel && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-ppc64le.Dockerfile b/ci/containers/debian-11-cross-ppc64le.Dockerfile index cfbef7dcbc..8f9f729909 100644 --- a/ci/containers/debian-11-cross-ppc64le.Dockerfile +++ b/ci/containers/debian-11-cross-ppc64le.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:ppc64el \ libudev-dev:ppc64el \ libxml2-dev:ppc64el \ - libyajl-dev:ppc64el \ systemtap-sdt-dev:ppc64el && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11-cross-s390x.Dockerfile b/ci/containers/debian-11-cross-s390x.Dockerfile index 1b7cee0572..b09076b148 100644 --- a/ci/containers/debian-11-cross-s390x.Dockerfile +++ b/ci/containers/debian-11-cross-s390x.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:s390x \ libudev-dev:s390x \ libxml2-dev:s390x \ - libyajl-dev:s390x \ systemtap-sdt-dev:s390x && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-11.Dockerfile b/ci/containers/debian-11.Dockerfile index da72d538c0..1660bd9c52 100644 --- a/ci/containers/debian-11.Dockerfile +++ b/ci/containers/debian-11.Dockerfile @@ -66,7 +66,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/containers/debian-12-cross-aarch64.Dockerfile b/ci/containers/debian-12-cross-aarch64.Dockerfile index 1504ba0b72..e57cbffaec 100644 --- a/ci/containers/debian-12-cross-aarch64.Dockerfile +++ b/ci/containers/debian-12-cross-aarch64.Dockerfile @@ -100,7 +100,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libudev-dev:arm64 \ libxen-dev:arm64 \ libxml2-dev:arm64 \ - libyajl-dev:arm64 \ systemtap-sdt-dev:arm64 && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-armv6l.Dockerfile b/ci/containers/debian-12-cross-armv6l.Dockerfile index ce2c71d466..9572f4d28f 100644 --- a/ci/containers/debian-12-cross-armv6l.Dockerfile +++ b/ci/containers/debian-12-cross-armv6l.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:armel \ libudev-dev:armel \ libxml2-dev:armel \ - libyajl-dev:armel \ systemtap-sdt-dev:armel && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-armv7l.Dockerfile b/ci/containers/debian-12-cross-armv7l.Dockerfile index 410f4fe15d..e29eea8a6b 100644 --- a/ci/containers/debian-12-cross-armv7l.Dockerfile +++ b/ci/containers/debian-12-cross-armv7l.Dockerfile @@ -100,7 +100,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libudev-dev:armhf \ libxen-dev:armhf \ libxml2-dev:armhf \ - libyajl-dev:armhf \ systemtap-sdt-dev:armhf && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-i686.Dockerfile b/ci/containers/debian-12-cross-i686.Dockerfile index 4ae974eb16..39f5e9ef8d 100644 --- a/ci/containers/debian-12-cross-i686.Dockerfile +++ b/ci/containers/debian-12-cross-i686.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:i386 \ libudev-dev:i386 \ libxml2-dev:i386 \ - libyajl-dev:i386 \ systemtap-sdt-dev:i386 && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-mips64el.Dockerfile b/ci/containers/debian-12-cross-mips64el.Dockerfile index 9664b30c14..af15c9c76a 100644 --- a/ci/containers/debian-12-cross-mips64el.Dockerfile +++ b/ci/containers/debian-12-cross-mips64el.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:mips64el \ libudev-dev:mips64el \ libxml2-dev:mips64el \ - libyajl-dev:mips64el \ systemtap-sdt-dev:mips64el && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-mipsel.Dockerfile b/ci/containers/debian-12-cross-mipsel.Dockerfile index 4692d1ce8c..63caa15b20 100644 --- a/ci/containers/debian-12-cross-mipsel.Dockerfile +++ b/ci/containers/debian-12-cross-mipsel.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:mipsel \ libudev-dev:mipsel \ libxml2-dev:mipsel \ - libyajl-dev:mipsel \ systemtap-sdt-dev:mipsel && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-ppc64le.Dockerfile b/ci/containers/debian-12-cross-ppc64le.Dockerfile index 17beefaea6..6c6e747120 100644 --- a/ci/containers/debian-12-cross-ppc64le.Dockerfile +++ b/ci/containers/debian-12-cross-ppc64le.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:ppc64el \ libudev-dev:ppc64el \ libxml2-dev:ppc64el \ - libyajl-dev:ppc64el \ systemtap-sdt-dev:ppc64el && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12-cross-s390x.Dockerfile b/ci/containers/debian-12-cross-s390x.Dockerfile index 88006f9a74..4e124ca26a 100644 --- a/ci/containers/debian-12-cross-s390x.Dockerfile +++ b/ci/containers/debian-12-cross-s390x.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:s390x \ libudev-dev:s390x \ libxml2-dev:s390x \ - libyajl-dev:s390x \ systemtap-sdt-dev:s390x && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-12.Dockerfile b/ci/containers/debian-12.Dockerfile index 8b34ea98fb..682f8217f4 100644 --- a/ci/containers/debian-12.Dockerfile +++ b/ci/containers/debian-12.Dockerfile @@ -66,7 +66,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/containers/debian-sid-cross-aarch64.Dockerfile b/ci/containers/debian-sid-cross-aarch64.Dockerfile index cbbea29d12..1932a7cfbe 100644 --- a/ci/containers/debian-sid-cross-aarch64.Dockerfile +++ b/ci/containers/debian-sid-cross-aarch64.Dockerfile @@ -100,7 +100,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libudev-dev:arm64 \ libxen-dev:arm64 \ libxml2-dev:arm64 \ - libyajl-dev:arm64 \ systemtap-sdt-dev:arm64 && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid-cross-armv6l.Dockerfile b/ci/containers/debian-sid-cross-armv6l.Dockerfile index 94d130baf8..bd7b1a12a3 100644 --- a/ci/containers/debian-sid-cross-armv6l.Dockerfile +++ b/ci/containers/debian-sid-cross-armv6l.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:armel \ libudev-dev:armel \ libxml2-dev:armel \ - libyajl-dev:armel \ systemtap-sdt-dev:armel && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid-cross-armv7l.Dockerfile b/ci/containers/debian-sid-cross-armv7l.Dockerfile index b1251ffec3..a0ee83d25b 100644 --- a/ci/containers/debian-sid-cross-armv7l.Dockerfile +++ b/ci/containers/debian-sid-cross-armv7l.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libudev-dev:armhf \ libxen-dev:armhf \ libxml2-dev:armhf \ - libyajl-dev:armhf \ systemtap-sdt-dev:armhf && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid-cross-i686.Dockerfile b/ci/containers/debian-sid-cross-i686.Dockerfile index 30b1c268a2..b2f96a6c03 100644 --- a/ci/containers/debian-sid-cross-i686.Dockerfile +++ b/ci/containers/debian-sid-cross-i686.Dockerfile @@ -98,7 +98,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:i386 \ libudev-dev:i386 \ libxml2-dev:i386 \ - libyajl-dev:i386 \ systemtap-sdt-dev:i386 && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid-cross-mips64el.Dockerfile b/ci/containers/debian-sid-cross-mips64el.Dockerfile index 216dbacfa1..bcb24e13ff 100644 --- a/ci/containers/debian-sid-cross-mips64el.Dockerfile +++ b/ci/containers/debian-sid-cross-mips64el.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:mips64el \ libudev-dev:mips64el \ libxml2-dev:mips64el \ - libyajl-dev:mips64el \ systemtap-sdt-dev:mips64el && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid-cross-ppc64le.Dockerfile b/ci/containers/debian-sid-cross-ppc64le.Dockerfile index 2e93762cbf..66180dcb1e 100644 --- a/ci/containers/debian-sid-cross-ppc64le.Dockerfile +++ b/ci/containers/debian-sid-cross-ppc64le.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:ppc64el \ libudev-dev:ppc64el \ libxml2-dev:ppc64el \ - libyajl-dev:ppc64el \ systemtap-sdt-dev:ppc64el && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid-cross-s390x.Dockerfile b/ci/containers/debian-sid-cross-s390x.Dockerfile index e106382a21..5f9fbc8ffd 100644 --- a/ci/containers/debian-sid-cross-s390x.Dockerfile +++ b/ci/containers/debian-sid-cross-s390x.Dockerfile @@ -99,7 +99,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libtirpc-dev:s390x \ libudev-dev:s390x \ libxml2-dev:s390x \ - libyajl-dev:s390x \ systemtap-sdt-dev:s390x && \ eatmydata apt-get autoremove -y && \ eatmydata apt-get autoclean -y && \ diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile index 1bf2fa5a00..87aee59bbd 100644 --- a/ci/containers/debian-sid.Dockerfile +++ b/ci/containers/debian-sid.Dockerfile @@ -66,7 +66,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/containers/fedora-39.Dockerfile b/ci/containers/fedora-39.Dockerfile index 6a528ba71b..2e35ca426d 100644 --- a/ci/containers/fedora-39.Dockerfile +++ b/ci/containers/fedora-39.Dockerfile @@ -94,8 +94,7 @@ exec "$@"\n' > /usr/bin/nosync && \ systemd-rpm-macros \ systemtap-sdt-devel \ wireshark-devel \ - xen-devel \ - yajl-devel && \ + xen-devel && \ nosync dnf autoremove -y && \ nosync dnf clean all -y && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ diff --git a/ci/containers/fedora-40.Dockerfile b/ci/containers/fedora-40.Dockerfile index 4f22956c3c..b82a975bdb 100644 --- a/ci/containers/fedora-40.Dockerfile +++ b/ci/containers/fedora-40.Dockerfile @@ -94,8 +94,7 @@ exec "$@"\n' > /usr/bin/nosync && \ systemd-rpm-macros \ systemtap-sdt-devel \ wireshark-devel \ - xen-devel \ - yajl-devel && \ + xen-devel && \ nosync dnf autoremove -y && \ nosync dnf clean all -y && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ diff --git a/ci/containers/fedora-rawhide.Dockerfile b/ci/containers/fedora-rawhide.Dockerfile index 5d1cc5961c..a673f82b4b 100644 --- a/ci/containers/fedora-rawhide.Dockerfile +++ b/ci/containers/fedora-rawhide.Dockerfile @@ -95,8 +95,7 @@ exec "$@"\n' > /usr/bin/nosync && \ systemd-rpm-macros \ systemtap-sdt-devel \ wireshark-devel \ - xen-devel \ - yajl-devel && \ + xen-devel && \ nosync dnf autoremove -y && \ nosync dnf clean all -y && \ rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ diff --git a/ci/containers/opensuse-leap-15.Dockerfile b/ci/containers/opensuse-leap-15.Dockerfile index 614af86f2c..38160bf7dc 100644 --- a/ci/containers/opensuse-leap-15.Dockerfile +++ b/ci/containers/opensuse-leap-15.Dockerfile @@ -60,7 +60,6 @@ RUN zypper update -y && \ libxml2 \ libxml2-devel \ libxslt \ - libyajl-devel \ lvm2 \ make \ meson \ diff --git a/ci/containers/opensuse-tumbleweed.Dockerfile b/ci/containers/opensuse-tumbleweed.Dockerfile index bf47571338..82b6aee142 100644 --- a/ci/containers/opensuse-tumbleweed.Dockerfile +++ b/ci/containers/opensuse-tumbleweed.Dockerfile @@ -60,7 +60,6 @@ RUN zypper dist-upgrade -y && \ libxml2 \ libxml2-devel \ libxslt \ - libyajl-devel \ lvm2 \ make \ meson \ diff --git a/ci/containers/ubuntu-2204.Dockerfile b/ci/containers/ubuntu-2204.Dockerfile index 5de2ac6801..18555693d1 100644 --- a/ci/containers/ubuntu-2204.Dockerfile +++ b/ci/containers/ubuntu-2204.Dockerfile @@ -67,7 +67,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/containers/ubuntu-2404.Dockerfile b/ci/containers/ubuntu-2404.Dockerfile index 86bab63fc9..b2f461b629 100644 --- a/ci/containers/ubuntu-2404.Dockerfile +++ b/ci/containers/ubuntu-2404.Dockerfile @@ -67,7 +67,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \ libxen-dev \ libxml2-dev \ libxml2-utils \ - libyajl-dev \ locales \ lvm2 \ make \ diff --git a/ci/lcitool/projects/libvirt.yml b/ci/lcitool/projects/libvirt.yml index a02fe9b8bf..b29fe227bb 100644 --- a/ci/lcitool/projects/libvirt.yml +++ b/ci/lcitool/projects/libvirt.yml @@ -81,4 +81,3 @@ packages: - xen - xmllint - xsltproc - - yajl -- 2.45.2

On Wed, Aug 14, 2024 at 23:40:15 +0200, Ján Tomko wrote:
As requested by: https://gitlab.com/libvirt/libvirt/-/issues/581
The ci update depends on the following libvirt-ci MR: https://gitlab.com/libvirt/libvirt-ci/-/merge_requests/497 targets: bump OpenSUSE Leap to 15.6
Pipeline: https://gitlab.com/janotomko/libvirt/-/pipelines/1413887401/
Ján Tomko (20): tests: json: relax some test cases ci: update OpenSUSE Leap to 15.6 util: json: introduce virJSONStringPrettifyBlanks tests: switch to compact empty JSON object formatting meson: add option for building with json-c meson: link libvirt with json_c if available util: json: write a json-c implementation ci: install json-c too meson: nss: link with json-c if available nss: convert findLeases to use json-c nss: convert findMACs to use json-c tests: depend on WITH_JSON_C instead of WITH_YAJL meson: switch checks to depend on json-c instead of yajl meson-options: switch to depend on json-c instead of yajl libvirt-spec: switch to building with json-c meson: do not link anything with yajl anymore meson: options: drop yajl meson: drop yajl detection util: drop dead code ci: drop yajl completely
Overall looks good to me but there are few loose ends in terms of building with the NSS modules as they don't have another implementation for the switchover but are rather rewritten at once, which could pose problems if rebasing across this series. I suggest you enforce, for the duration of the series that both yajl and json-c are installed if either of them is selected. Als some of the meson patches could really be squashed together.
participants (2)
-
Ján Tomko
-
Peter Krempa