[libvirt PATCHv2 00/15] Switch to json-c from yajl

Ján Tomko (15): util: json: introduce virJSONStringPrettifyBlanks tests: switch to compact empty JSON object formatting build: introduce WITH_JSON ci: install json-c too meson: add option for building with json-c meson: switch checks to depend on json-c as well as yajl build: do not depend on yajl build: link with json_c util: json: write a json-c implementation nss: convert findLeases to use json-c nss: convert findMACs to use json-c meson: do not link anything with yajl anymore meson: options: drop yajl meson: drop yajl detection 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 | 2 +- ci/containers/opensuse-tumbleweed.Dockerfile | 2 +- ci/containers/ubuntu-2204.Dockerfile | 2 +- ci/containers/ubuntu-2404.Dockerfile | 2 +- ci/lcitool/projects/libvirt.yml | 2 +- libvirt.spec.in | 6 +- meson.build | 62 +-- meson_options.txt | 8 +- src/libvirt_private.syms | 1 + src/meson.build | 2 +- src/util/meson.build | 2 +- src/util/virjson.c | 485 +++++------------- 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/virmacmaptest.c | 5 +- tests/virmacmaptestdata/empty.json | 4 +- tests/virnetdaemontest.c | 2 +- tests/virstoragetest.c | 4 +- tools/nss/libvirt_nss_leases.c | 370 +++++-------- tools/nss/libvirt_nss_macs.c | 278 +++------- tools/nss/meson.build | 4 +- 99 files changed, 475 insertions(+), 972 deletions(-) -- 2.46.0

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> Reviewed-by: Peter Krempa <pkrempa@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 af40e5dca3..d186dc40df 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2612,6 +2612,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.46.0

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> Reviewed-by: Peter Krempa <pkrempa@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.46.0

Some tests depend on WITH_YAJL even though the actual library used does not make a difference. Introduce WITH_JSON for a smoother transition. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 1 + tests/meson.build | 6 +++--- tests/virnetdaemontest.c | 2 +- tests/virstoragetest.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index eb4b608e85..0c7ae1b68b 100644 --- a/meson.build +++ b/meson.build @@ -1409,6 +1409,7 @@ if yajl_dep.found() endif conf.set('WITH_YAJL', 1) + conf.set('WITH_JSON', 1) endif diff --git a/tests/meson.build b/tests/meson.build index 2f1eda1f95..700a5d4049 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -329,7 +329,7 @@ if host_machine.system() == 'linux' { 'name': 'virscsitest' }, { 'name': 'virusbtest' }, ] - if conf.has('WITH_YAJL') + if conf.has('WITH_JSON') tests += [ { 'name': 'virnetdevopenvswitchtest' }, ] @@ -406,7 +406,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') tests += [ { 'name': 'nodedevmdevctltest', 'link_with': [ node_device_driver_impl ] }, ] @@ -555,7 +555,7 @@ if conf.has('WITH_VMX') ] endif -if conf.has('WITH_YAJL') +if conf.has('WITH_JSON') tests += [ { 'name': 'virjsontest' }, { 'name': 'virmacmaptest' }, diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index 74c20479d4..1a5c5f32e1 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) struct testClientPriv { int magic; }; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index d07a05d04b..75d04e8030 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 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 */ return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; } -- 2.46.0

On Thu, Sep 05, 2024 at 15:49:30 +0200, Ján Tomko wrote:
Some tests depend on WITH_YAJL even though the actual library used does not make a difference. Introduce WITH_JSON for a smoother transition.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 1 + tests/meson.build | 6 +++--- tests/virnetdaemontest.c | 2 +- tests/virstoragetest.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Install json-c to ensure the pipeline stays green throughout the series. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Peter Krempa <pkrempa@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.46.0

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 | 2 ++ meson.build | 8 ++++++++ meson_options.txt | 1 + 3 files changed, 11 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 86af13a861..2bc4aa98d4 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1369,6 +1369,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dapparmor_profiles=disabled \ -Dsecdriver_apparmor=disabled \ -Dudev=enabled \ + -Djson_c=disabled \ -Dyajl=enabled \ %{?arg_sanlock} \ -Dlibpcap=enabled \ @@ -1441,6 +1442,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 0c7ae1b68b..855df79e62 100644 --- a/meson.build +++ b/meson.build @@ -1018,6 +1018,13 @@ 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) + conf.set('WITH_JSON', 1) +endif + # Check for BSD kvm (kernel memory interface) if host_machine.system() == 'freebsd' libkvm_dep = cc.find_library('kvm') @@ -2343,6 +2350,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.46.0

On Thu, Sep 05, 2024 at 15:49:32 +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 | 2 ++ meson.build | 8 ++++++++ meson_options.txt | 1 + 3 files changed, 11 insertions(+)
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Ensure both are required during this series to make bisecting smooth. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 3 ++- meson.build | 12 ++++++------ meson_options.txt | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 2bc4aa98d4..63ac63cb45 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -362,6 +362,7 @@ 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,8 +1370,8 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dapparmor_profiles=disabled \ -Dsecdriver_apparmor=disabled \ -Dudev=enabled \ - -Djson_c=disabled \ -Dyajl=enabled \ + -Djson_c=enabled \ %{?arg_sanlock} \ -Dlibpcap=enabled \ %{?arg_nbdkit} \ diff --git a/meson.build b/meson.build index 855df79e62..e15514ea00 100644 --- a/meson.build +++ b/meson.build @@ -1622,10 +1622,10 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a endif endif - if not yajl_dep.found() + if not yajl_dep.found() or 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 @@ -1696,10 +1696,10 @@ endif if not get_option('driver_qemu').disabled() use_qemu = true - if not yajl_dep.found() + if not yajl_dep.found() or 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 @@ -2029,9 +2029,9 @@ endif if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() + if not yajl_dep.found() or 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 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.46.0

On Thu, Sep 05, 2024 at 15:49:33 +0200, Ján Tomko wrote:
Ensure both are required during this series to make bisecting smooth.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 3 ++- meson.build | 12 ++++++------ meson_options.txt | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 2bc4aa98d4..63ac63cb45 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -362,6 +362,7 @@ 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,8 +1370,8 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec) -Dapparmor_profiles=disabled \ -Dsecdriver_apparmor=disabled \ -Dudev=enabled \ - -Djson_c=disabled \ -Dyajl=enabled \ + -Djson_c=enabled \ %{?arg_sanlock} \ -Dlibpcap=enabled \ %{?arg_nbdkit} \ diff --git a/meson.build b/meson.build index 855df79e62..e15514ea00 100644 --- a/meson.build +++ b/meson.build @@ -1622,10 +1622,10 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a endif endif
- if not yajl_dep.found() + if not yajl_dep.found() or 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
@@ -1696,10 +1696,10 @@ endif if not get_option('driver_qemu').disabled() use_qemu = true
- if not yajl_dep.found() + if not yajl_dep.found() or 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
@@ -2029,9 +2029,9 @@ endif
if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() + if not yajl_dep.found() or 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
I'd prefer if the error messages spell out both libraries in the interim with wording saying that you need both. It could trip up somebody in the future bisecting into the past without having yajl installed. Since you'll be fixing the checks later on I thing the overhead of changing the comments should be okay. Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 4 +--- meson.build | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/libvirt.spec.in b/libvirt.spec.in index 63ac63cb45..caca0bcb95 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -361,7 +361,6 @@ 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 @@ -1370,7 +1369,6 @@ 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 \ @@ -1486,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 diff --git a/meson.build b/meson.build index e15514ea00..977ca527f6 100644 --- a/meson.build +++ b/meson.build @@ -1622,7 +1622,7 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a endif endif - if not yajl_dep.found() or not json_c_dep.found() + if not json_c_dep.found() use_ch = false if get_option('driver_ch').enabled() error('json-c is required to build Cloud-Hypervisor driver') @@ -1696,7 +1696,7 @@ endif if not get_option('driver_qemu').disabled() use_qemu = true - if not yajl_dep.found() or not json_c_dep.found() + if not json_c_dep.found() use_qemu = false if get_option('driver_qemu').enabled() error('json-c is required to build QEMU driver') @@ -2029,7 +2029,7 @@ endif if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() or not json_c_dep.found() + if not json_c_dep.found() if get_option('nss').enabled() error('Can\'t build nss plugin without json-c') else -- 2.46.0

On Thu, Sep 05, 2024 at 15:49:34 +0200, Ján Tomko wrote:
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- libvirt.spec.in | 4 +--- meson.build | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 63ac63cb45..caca0bcb95 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -361,7 +361,6 @@ 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 @@ -1370,7 +1369,6 @@ 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 \ @@ -1486,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 diff --git a/meson.build b/meson.build index e15514ea00..977ca527f6 100644 --- a/meson.build +++ b/meson.build @@ -1622,7 +1622,7 @@ if not get_option('driver_ch').disabled() and host_machine.system() == 'linux' a endif endif
- if not yajl_dep.found() or not json_c_dep.found() + if not json_c_dep.found()
This is a bit premature ;) You most likely wanted to move it after rewriting the parsers/formatters/. Once placed properly and with a commit message saying that it's placed properly ("Now that all JSON code was rewritten to ...") ...
use_ch = false if get_option('driver_ch').enabled() error('json-c is required to build Cloud-Hypervisor driver')
... and also these fixed after previous suggestion ..
@@ -1696,7 +1696,7 @@ endif if not get_option('driver_qemu').disabled() use_qemu = true
- if not yajl_dep.found() or not json_c_dep.found() + if not json_c_dep.found() use_qemu = false if get_option('driver_qemu').enabled() error('json-c is required to build QEMU driver') @@ -2029,7 +2029,7 @@ endif
if not get_option('nss').disabled() use_nss = true - if not yajl_dep.found() or not json_c_dep.found() + if not json_c_dep.found() if get_option('nss').enabled() error('Can\'t build nss plugin without json-c')
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 + tools/nss/meson.build | 2 ++ 4 files changed, 5 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 700a5d4049..e8fd9bac0c 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, 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.46.0

On Thu, Sep 05, 2024 at 15:49:35 +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 + tools/nss/meson.build | 2 ++ 4 files changed, 5 insertions(+)
I'd squash this into 6/15 as you enable it there, or in the appropriate commits adding the code. But as a standalone commit it doesn't make too much sense IMO.

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 | 167 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-) diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..8e0ba47fc9 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> @@ -1390,7 +1392,168 @@ virJSONValueCopy(const virJSONValue *in) } -#if WITH_YAJL +#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj) +{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL; + + 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; + } + + 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: + 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: + 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 jsonflags = JSON_C_TO_STRING_NOSLASHESCAPE; + + if (pretty) + jsonflags |= JSON_C_TO_STRING_PRETTY | JSON_C_TO_STRING_SPACED; + + jobj = virJSONValueToJsonC(object); + + str = json_object_to_json_string_length(jobj, jsonflags, &len); + + virBufferAdd(buf, str, len); + if (pretty) + virBufferAddLit(buf, "\n"); + + json_object_put(jobj); + return 0; +} + + +#elif WITH_YAJL static int virJSONParserInsertValue(virJSONParser *parser, virJSONValue **value) -- 2.46.0

On Thu, Sep 05, 2024 at 15:49:36 +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 | 167 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..8e0ba47fc9 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>
@@ -1390,7 +1392,168 @@ virJSONValueCopy(const virJSONValue *in) }
-#if WITH_YAJL +#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj) +{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL; + + 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(); + {
Unaddressed from previous review. Either everything inside the block or no block at all.
+ 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; + } + + 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: + 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: + 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. */
Unaddressed from previous review: /* Yes. That's a random value. json-c will use the provided string representation in the JSON document it outputs. The 'json_object' tree will not be used outside of this function and thus the actual numeric value is irrelevant. */
+ 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: return json_object_new_null();
Which should be available in 0.14 we require. But yes I'm aware that it'd be correct without: struct json_object *json_object_new_null(void) { return NULL; } In case you'd want to stick with 'return NULL' this will require a comment and I'll like to see it before comitting.
+ default: + return NULL; + } + return NULL; +}
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On a Friday in 2024, Peter Krempa wrote:
On Thu, Sep 05, 2024 at 15:49:36 +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 | 167 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..8e0ba47fc9 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>
@@ -1390,7 +1392,168 @@ virJSONValueCopy(const virJSONValue *in) }
-#if WITH_YAJL +#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj) +{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL; + + 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(); + {
Unaddressed from previous review. Either everything inside the block or no block at all.
Previous review:
This block-in-case style is very punk.
I think leaving it very-punkish addressed your comments just fine :P
+ 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: {
[...]
+ 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. */
Unaddressed from previous review:
/* Yes. That's a random value. json-c will use the provided string representation in the JSON document it outputs. The 'json_object' tree will not be used outside of this function and thus the actual numeric value is irrelevant. */
That doesn't sound right. The json_object will be used outside of this function, but the formatter will use the string instead of the numeric value.
+ 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: return json_object_new_null();
Which should be available in 0.14 we require. But yes I'm aware that it'd be correct without:
struct json_object *json_object_new_null(void) { return NULL; }
In case you'd want to stick with 'return NULL' this will require a comment and I'll like to see it before comitting.
I am confused here, do you prefer json_object_new_null() or returning NULL directly? And why would either of those require a comment? Jano
+ default: + return NULL; + } + return NULL; +}
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On Fri, Sep 06, 2024 at 11:46:16 +0200, Ján Tomko wrote:
On a Friday in 2024, Peter Krempa wrote:
On Thu, Sep 05, 2024 at 15:49:36 +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 | 167 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..8e0ba47fc9 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>
@@ -1390,7 +1392,168 @@ virJSONValueCopy(const virJSONValue *in) }
-#if WITH_YAJL +#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj) +{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL; + + 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(); + {
Unaddressed from previous review. Either everything inside the block or no block at all.
Previous review:
This block-in-case style is very punk.
I think leaving it very-punkish addressed your comments just fine :P
Sigh. Okay I'll be more direct next time.
+ 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: {
[...]
+ 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. */
Unaddressed from previous review:
That doesn't sound right. The json_object will be used outside of this function, but the formatter will use the string instead of the numeric value.
You are technically correct. 'json_object' will be used outside, but strictly to format the json. So: /* Yes. That's a random value. json-c will use the provided string representation in the JSON document it outputs. The 'json_object' tree created here is not used for anything else besides the JSON string output, thus the actual numeric value doesn't matter. */
+ 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: return json_object_new_null();
Which should be available in 0.14 we require. But yes I'm aware that it'd be correct without:
struct json_object *json_object_new_null(void) { return NULL; }
In case you'd want to stick with 'return NULL' this will require a comment and I'll like to see it before comitting.
I am confused here, do you prefer json_object_new_null() or returning NULL directly?
I prefer json_object_new_null()
And why would either of those require a comment?
Returning NULL directly does require a comment. Espeically since it's right next to the 'default:' case which would signify a programming error which returns exactly the same value. It looked wrong and made me look it up.
Jano
+ default: + return NULL; + } + return NULL; +}
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On a Friday in 2024, Peter Krempa wrote:
On Fri, Sep 06, 2024 at 11:46:16 +0200, Ján Tomko wrote:
On a Friday in 2024, Peter Krempa wrote:
On Thu, Sep 05, 2024 at 15:49:36 +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 | 167 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 165 insertions(+), 2 deletions(-)
diff --git a/src/util/virjson.c b/src/util/virjson.c index 0edf86cd1c..8e0ba47fc9 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>
@@ -1390,7 +1392,168 @@ virJSONValueCopy(const virJSONValue *in) }
-#if WITH_YAJL +#if WITH_JSON_C +static virJSONValue * +virJSONValueFromJsonC(json_object *jobj) +{ + enum json_type type = json_object_get_type(jobj); + virJSONValue *ret = NULL; + + 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(); + {
Unaddressed from previous review. Either everything inside the block or no block at all.
Previous review:
This block-in-case style is very punk.
I think leaving it very-punkish addressed your comments just fine :P
Sigh. Okay I'll be more direct next time.
I've changed it to use the less punk-ish C version: case json_type_object: { json_object_iter iter; ret = virJSONValueNewObject(); json_object_object_foreachC(jobj, iter) { virJSONValue *cur = virJSONValueFromJsonC(iter.val); if (virJSONValueObjectAppend(ret, iter.key, &cur) < 0) { g_free(ret); return NULL; } } break; } [..]
+ 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: return json_object_new_null();
Which should be available in 0.14 we require. But yes I'm aware that it'd be correct without:
struct json_object *json_object_new_null(void) { return NULL; }
In case you'd want to stick with 'return NULL' this will require a comment and I'll like to see it before comitting.
I am confused here, do you prefer json_object_new_null() or returning NULL directly?
I prefer json_object_new_null()
Done. Jano
And why would either of those require a comment?
Returning NULL directly does require a comment. Espeically since it's right next to the 'default:' case which would signify a programming error which returns exactly the same value.
It looked wrong and made me look it up.
Jano
+ default: + return NULL; + } + return NULL; +}
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

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 | 370 +++++++++++---------------------- 1 file changed, 119 insertions(+), 251 deletions(-) diff --git a/tools/nss/libvirt_nss_leases.c b/tools/nss/libvirt_nss_leases.c index 770dae8625..0b8bae1d0f 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)), @@ -156,190 +128,120 @@ appendAddr(const char *name __attribute__((unused)), } +/** + * findLeaseInJSON + * + * @jobj: the json object containing the leases + * @name: the requested hostname (optional if a MAC address is present) + * @macs: the array of MAC addresses we're matching (optional if we have a hostname) + * @nmacs: the size of the MAC array + * @af: the requested address family + * @now: current time (to eliminate expired leases) + * @addrs: the returned matching addresses + * @naddrs: size of the returned array + * @found: whether a match was found + * + * Returns 0 even if nothing was found + * -1 on error + */ 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; - - 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; - } - return 1; -} - - -static int -findLeasesParserString(void *ctx, - const unsigned char *stringVal, - size_t stringLen) -{ - findLeasesParser *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_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; - } 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; + int len; - DEBUG("Parse end map state=%d", parser->state); - - if (parser->entry.macaddr == NULL) - return 0; - - if (parser->state != FIND_LEASES_STATE_ENTRY) - return 0; - - 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; - } - } 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; + if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; } - 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; + 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; + + lease = json_object_array_get_idx(jobj, i); + + if (macs) { + const char *macAddr; + bool match = false; + json_object *val; + size_t j; + + 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 { + const char *leaseName; + json_object *val; + + val = json_object_object_get(lease, "hostname"); + if (!val) + continue; + + leaseName = json_object_get_string(val); + if (!leaseName) + continue; + + if (strcasecmp(leaseName, name) != 0) + continue; + } - 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 > 0 && 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 +258,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; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; char line[1024]; ssize_t nreadTotal = 0; int rv; @@ -389,51 +271,37 @@ 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)); + do { + 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; - } - } + jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); + } while (jerr == json_tokener_continue); - 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.46.0

On Thu, Sep 05, 2024 at 15:49:37 +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 | 370 +++++++++++---------------------- 1 file changed, 119 insertions(+), 251 deletions(-)
[...]
@@ -156,190 +128,120 @@ appendAddr(const char *name __attribute__((unused)), }
Subsequent hunks have the deletions trimmed to just show the new code.
+/** + * findLeaseInJSON + * + * @jobj: the json object containing the leases + * @name: the requested hostname (optional if a MAC address is present) + * @macs: the array of MAC addresses we're matching (optional if we have a hostname) + * @nmacs: the size of the MAC array + * @af: the requested address family + * @now: current time (to eliminate expired leases) + * @addrs: the returned matching addresses + * @naddrs: size of the returned array + * @found: whether a match was found + * + * Returns 0 even if nothing was found + * -1 on error + */ static int +findLeaseInJSON(json_object *jobj, + const char *name, + char **macs, + size_t nmacs, + int af, + time_t now, + leaseAddress **addrs, + size_t *naddrs, + bool *found) { size_t i; + int len;
+ if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + 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; + + lease = json_object_array_get_idx(jobj, i); + + if (macs) { + const char *macAddr; + bool match = false; + json_object *val; + size_t j; + + 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)) {
strcmp(..) != 0
+ match = true; + break; + } + } + if (!match) + continue; + } else { + const char *leaseName; + json_object *val; + + val = json_object_object_get(lease, "hostname"); + if (!val) + continue; + + leaseName = json_object_get_string(val); + if (!leaseName) + continue; + + if (strcasecmp(leaseName, name) != 0) + continue; + }
+ 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 > 0 && expiryTime < now) { + DEBUG("Skipping expired lease for %s", name); + continue; + }
+ 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("Found record for %s", name); + *found = true;
+ if (appendAddr(name, + addrs, naddrs, + ipaddr, + expiryTime, + af) < 0) + return -1; }
+ return 0; }
@@ -356,30 +258,10 @@ findLeases(const char *file, { int fd = -1; int ret = -1; + json_object *jobj = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr; + int jsonflags = JSON_TOKENER_STRICT | JSON_TOKENER_VALIDATE_UTF8; char line[1024]; ssize_t nreadTotal = 0; int rv; @@ -389,51 +271,37 @@ findLeases(const char *file, goto cleanup; }
+ tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags);
+ do { + rv = read(fd, line, sizeof(line) - 1);
-1 should not be needed here
if (rv < 0) goto cleanup; if (rv == 0) break;
So if you get an incomplete JSON document of exactly sizeof(len) bytes, this will go through the first loop adn thend break out ...
nreadTotal += rv;
+ jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); + } while (jerr == json_tokener_continue);
+ if (nreadTotal > 0 && jerr != json_tokener_success) {
... this condition will match as we read something and 'jerr' is still 'json_tokener_continue'
+ ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr));
So this error will read: Cannot parse /path/to/file: continue Thus you also need to specialcase also json_tokener_continue case to state that the file is incomplete.
goto cleanup; }
+ 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 (fd != -1) close(fd); return ret;
With the corner case fixed: Reviewed-by: Peter Krempa <pkrempa@redhat.com>

On a Friday in 2024, Peter Krempa wrote:
On Thu, Sep 05, 2024 at 15:49:37 +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 | 370 +++++++++++---------------------- 1 file changed, 119 insertions(+), 251 deletions(-)
+/** + * findLeaseInJSON + * + * @jobj: the json object containing the leases + * @name: the requested hostname (optional if a MAC address is present) + * @macs: the array of MAC addresses we're matching (optional if we have a hostname) + * @nmacs: the size of the MAC array + * @af: the requested address family + * @now: current time (to eliminate expired leases) + * @addrs: the returned matching addresses + * @naddrs: size of the returned array + * @found: whether a match was found + * + * Returns 0 even if nothing was found + * -1 on error + */ static int +findLeaseInJSON(json_object *jobj, + const char *name, + char **macs, + size_t nmacs, + int af, + time_t now, + leaseAddress **addrs, + size_t *naddrs, + bool *found) { size_t i; + int len;
+ if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + 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; + + lease = json_object_array_get_idx(jobj, i); + + if (macs) { + const char *macAddr; + bool match = false; + json_object *val; + size_t j; + + 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)) {
strcmp(..) != 0
I assume this was just a style comment, not about the logic, i.e. strcmp(..) == 0
+ match = true; + break; + } + } + if (!match) @@ -389,51 +271,37 @@ findLeases(const char *file, goto cleanup; }
+ tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags);
+ do { + rv = read(fd, line, sizeof(line) - 1);
-1 should not be needed here
if (rv < 0) goto cleanup; if (rv == 0) break;
So if you get an incomplete JSON document of exactly sizeof(len) bytes, this will go through the first loop adn thend break out ...
nreadTotal += rv;
+ jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); + } while (jerr == json_tokener_continue);
I've added: if (jerr == json_tokener_continue) { ERROR("Cannot parse %s: incomplete json found", file); goto cleanup; } Jano
+ if (nreadTotal > 0 && jerr != json_tokener_success) {
... this condition will match as we read something and 'jerr' is still
'json_tokener_continue'
+ ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr));
So this error will read:
Cannot parse /path/to/file: continue

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 | 278 ++++++++++------------------------- 1 file changed, 80 insertions(+), 198 deletions(-) diff --git a/tools/nss/libvirt_nss_macs.c b/tools/nss/libvirt_nss_macs.c index f45d149793..281865a05b 100644 --- a/tools/nss/libvirt_nss_macs.c +++ b/tools/nss/libvirt_nss_macs.c @@ -25,179 +25,89 @@ #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) -{ - 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; - - 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; - } - 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); - - if (parser->state != FIND_MACS_STATE_LIST) - return 0; - - free(parser->key); - parser->key = NULL; - parser->state = FIND_MACS_STATE_ENTRY; - - return 1; -} - +/** + * findMACsFromJSON + * + * @jobj: JSON object containing the leases + * @name: requested hostname + * @macs: returned array of MAC addresses leased to the hostname + * @nmacs: size of the returned array + */ static int -findMACsParserEndMap(void *ctx) +findMACsFromJSON(json_object *jobj, + const char *name, + char ***macs, + size_t *nmacs) { - findMACsParser *parser = ctx; size_t i; + int len; - DEBUG("Parse end map state=%d", parser->state); - - if (parser->entry.name == NULL) - return 0; - - if (parser->state != FIND_MACS_STATE_ENTRY) - return 0; - - if (!strcasecmp(parser->entry.name, parser->name)) { - char **macs = realloc(*parser->macs, - sizeof(char *) * ((*parser->nmacs) + parser->entry.nmacs)); - if (!macs) - 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]); + if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; } - free(parser->entry.macs); - parser->entry.macs = NULL; - parser->entry.nmacs = 0; - parser->state = FIND_MACS_STATE_LIST; + 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; + size_t j; + + entry = json_object_array_get_idx(jobj, i); + if (!entry) + continue; - return 1; -} + DEBUG("Processing item %zu", i); + domain = json_object_object_get(entry, "domain"); + if (!domain) + continue; -static int -findMACsParserStartArray(void *ctx) -{ - findMACsParser *parser = ctx; + domainName = json_object_get_string(domain); + if (!domainName) + continue; - DEBUG("Parse start array state=%d", parser->state); + DEBUG("Processing domain %s", domainName); - 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; + if (strcasecmp(domainName, name)) + continue; - return 1; -} + macsArray = json_object_object_get(entry, "macs"); + if (!macsArray) + continue; + newmacs = json_object_array_length(macsArray); + DEBUG("Found %zu MAC addresses", newmacs); -static int -findMACsParserEndArray(void *ctx) -{ - findMACsParser *parser = ctx; + tmpMacs = realloc(*macs, sizeof(char *) * (*nmacs + newmacs + 1)); + if (!tmpMacs) + return -1; - DEBUG("Parse end array state=%d", parser->state); + *macs = tmpMacs; - 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; + for (j = 0; j < newmacs; j++) { + json_object *macobj = NULL; + char *macstr; - return 1; + macobj = json_object_array_get_idx(macsArray, j); + macstr = strdup(json_object_get_string(macobj)); + if (!macstr) + return -1; + (*macs)[(*nmacs)++] = macstr; + } + } + return 0; } @@ -209,66 +119,45 @@ 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; + 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)); + do { + 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; - } - } + jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); + } while (jerr == json_tokener_continue); - 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 +167,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.46.0

On Thu, Sep 05, 2024 at 15:49:38 +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 | 278 ++++++++++------------------------- 1 file changed, 80 insertions(+), 198 deletions(-)
diff --git a/tools/nss/libvirt_nss_macs.c b/tools/nss/libvirt_nss_macs.c index f45d149793..281865a05b 100644 --- a/tools/nss/libvirt_nss_macs.c +++ b/tools/nss/libvirt_nss_macs.c
As in previous patch I'll trim the deletions to just se the new code:
+/** + * findMACsFromJSON + * + * @jobj: JSON object containing the leases + * @name: requested hostname + * @macs: returned array of MAC addresses leased to the hostname + * @nmacs: size of the returned array + */ static int +findMACsFromJSON(json_object *jobj, + const char *name, + char ***macs, + size_t *nmacs) { size_t i; + int len;
+ if (!json_object_is_type(jobj, json_type_array)) { + ERROR("parsed JSON does not contain the leases array"); + return -1; }
+ 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; + size_t j; + + entry = json_object_array_get_idx(jobj, i); + if (!entry) + continue;
+ DEBUG("Processing item %zu", i);
+ domain = json_object_object_get(entry, "domain"); + if (!domain) + continue;
+ domainName = json_object_get_string(domain); + if (!domainName) + continue;
+ DEBUG("Processing domain %s", domainName);
+ if (strcasecmp(domainName, name)) + continue;
+ macsArray = json_object_object_get(entry, "macs"); + if (!macsArray) + continue;
+ newmacs = json_object_array_length(macsArray); + DEBUG("Found %zu MAC addresses", newmacs);
+ tmpMacs = realloc(*macs, sizeof(char *) * (*nmacs + newmacs + 1)); + if (!tmpMacs) + return -1;
+ *macs = tmpMacs;
+ for (j = 0; j < newmacs; j++) { + json_object *macobj = NULL; + char *macstr;
+ macobj = json_object_array_get_idx(macsArray, j); + macstr = strdup(json_object_get_string(macobj)); + if (!macstr) + return -1; + (*macs)[(*nmacs)++] = macstr; + } + } + return 0; }
@@ -209,66 +119,45 @@ findMACs(const char *file, { int fd = -1; int ret = -1; char line[1024]; + json_object *jobj = NULL; + json_tokener *tok = NULL; + enum json_tokener_error jerr; + 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; }
+ tok = json_tokener_new(); + json_tokener_set_flags(tok, jsonflags);
+ do { + rv = read(fd, line, sizeof(line) - 1);
-1 unnecessary
if (rv < 0) goto cleanup; if (rv == 0) break; + nreadTotal += rv;
+ jobj = json_tokener_parse_ex(tok, line, rv); + jerr = json_tokener_get_error(tok); + } while (jerr == json_tokener_continue);
+ if (nreadTotal > 0 && jerr != json_tokener_success) { + ERROR("Cannot parse %s: %s", file, json_tokener_error_desc(jerr));
Same problem regarding the possibility to reach this with json_tokener_continue state as in previous patch.
goto cleanup; }
+ 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];
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 - 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 e8fd9bac0c..0d76d37959 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.46.0

On Thu, Sep 05, 2024 at 15:49:39 +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 - tools/nss/meson.build | 2 -- 4 files changed, 5 deletions(-)
This can be squashed into 13/15

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 caca0bcb95..3cb1dab98f 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 977ca527f6..9605d58537 100644 --- a/meson.build +++ b/meson.build @@ -1379,7 +1379,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.46.0

On Thu, Sep 05, 2024 at 15:49:40 +0200, Ján Tomko wrote:
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(-)
IMO you want to squash 7/15 and 12/15 into this patch as well as the detection bit of 14/15. Since the presence of #ifdef checks mentioning WITH_YAJL is not a problem the removal of the old implementation code can stay as a separate patch.
diff --git a/libvirt.spec.in b/libvirt.spec.in index caca0bcb95..3cb1dab98f 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 977ca527f6..9605d58537 100644 --- a/meson.build +++ b/meson.build @@ -1379,7 +1379,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')
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

After this commit, WITH_YAJL can no longer be set. Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 43 ----- src/util/virjson.c | 416 --------------------------------------------- 2 files changed, 459 deletions(-) diff --git a/meson.build b/meson.build index 9605d58537..a7c62d8bcc 100644 --- a/meson.build +++ b/meson.build @@ -1378,48 +1378,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) - conf.set('WITH_JSON', 1) -endif - - # generic build dependencies checks if bash_completion_dep.found() and not readline_dep.found() @@ -2374,7 +2332,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) diff --git a/src/util/virjson.c b/src/util/virjson.c index 8e0ba47fc9..0378adf00e 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 */ @@ -1553,418 +1549,6 @@ virJSONValueToBuffer(virJSONValue *object, } -#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.46.0

On Thu, Sep 05, 2024 at 15:49:41 +0200, Ján Tomko wrote:
After this commit, WITH_YAJL can no longer be set.
Signed-off-by: Ján Tomko <jtomko@redhat.com> --- meson.build | 43 ----- src/util/virjson.c | 416 --------------------------------------------- 2 files changed, 459 deletions(-)
diff --git a/meson.build b/meson.build index 9605d58537..a7c62d8bcc 100644 --- a/meson.build +++ b/meson.build @@ -1378,48 +1378,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) - conf.set('WITH_JSON', 1) -endif - - # generic build dependencies checks
if bash_completion_dep.found() and not readline_dep.found() @@ -2374,7 +2332,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)
As noted I think all of the compile time checks and dependency stuff should go into one patch so all of the above should go to 13/15. This removal below can be separate.
diff --git a/src/util/virjson.c b/src/util/virjson.c index 8e0ba47fc9..0378adf00e 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 */ @@ -1553,418 +1549,6 @@ virJSONValueToBuffer(virJSONValue *object, }
-#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 *
Reviewed-by: Peter Krempa <pkrempa@redhat.com>

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.46.0

On Thu, Sep 05, 2024 at 15:49:42 +0200, Ján Tomko wrote:
It is no longer used by libvirt so it's pointless to install it.
Signed-off-by: Ján Tomko <jtomko@redhat.com> ---
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
participants (2)
-
Ján Tomko
-
Peter Krempa