Skip to content

Commit

Permalink
More changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sourav Moitra <[email protected]>
  • Loading branch information
xw19 committed Dec 12, 2024
1 parent a3594fc commit 7e02bc2
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lua/lua_crun.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ luacrun_ctx_update_container (lua_State *S)
luaL_checkstack (S, 2, NULL);

json_error_t *error;
json_t *parsed_json = yajl_tree_parse (content, 0, error);
json_t *parsed_json = json_loads (content, 0, error);
if (parsed_json == NULL)
{
lua_pushboolean (S, false);
Expand All @@ -671,7 +671,7 @@ luacrun_ctx_update_container (lua_State *S)
runtime_spec_schema_config_schema_process *rt_spec_process;
parser_error p_err = NULL;
rt_spec_process = make_runtime_spec_schema_config_schema_process (parsed_json, &parser_ctx, &p_err);
yajl_tree_free (parsed_json);
json_decref (parsed_json);
if (rt_spec_process == NULL)
{
lua_pushboolean (S, false);
Expand Down
4 changes: 2 additions & 2 deletions python/crun_python.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ container_update (PyObject *self arg_unused, PyObject *args)
libcrun_context_t *ctx;
char *id = NULL;
char *content = NULL;
json_T *tree = NULL;
json_t *tree = NULL;
int ret;
parser_error parser_err = NULL;
struct parser_context parser_ctx = { 0, stderr };
Expand All @@ -398,7 +398,7 @@ container_update (PyObject *self arg_unused, PyObject *args)
return set_error (&err);

process = make_runtime_spec_schema_config_schema_process (tree, &parser_ctx, &parser_err);
yajl_tree_free (tree);
json_decref (tree);
if (process == NULL)
{
cleanup_free char *msg = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/crun.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ print_version (FILE *stream, struct argp_state *state arg_unused)

libcrun_handler_manager_print_feature_tags (libcrun_get_handler_manager (), stream);

fprintf (stream, "+YAJL\n");
fprintf (stream, "+ json_t\n");
}

static error_t
Expand Down
6 changes: 2 additions & 4 deletions src/libcrun/container.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
# include <systemd/sd-daemon.h>
#endif

#define YAJL_STR(x) ((const unsigned char *) (x))

enum
{
SYNC_SOCKET_SYNC_MESSAGE,
Expand Down Expand Up @@ -776,7 +774,7 @@ do_hooks (runtime_spec_schema_config_schema *def, pid_t pid, const char *id, boo
}

static int
get_yajl_result (json_t *root, char **out, size_t *out_len)
get_json_result (json_t *root, char **out, size_t *out_len)
{
char *buf = NULL;
size_t buf_len = 0;
Expand Down Expand Up @@ -904,7 +902,7 @@ get_seccomp_receiver_fd_payload (libcrun_container_t *container, const char *sta
goto exit;
/* End state. */

r = get_yajl_result (root, seccomp_fd_payload, seccomp_fd_payload_len);
r = get_json_result (root, seccomp_fd_payload, seccomp_fd_payload_len);

exit:
json_decref(root);
Expand Down
4 changes: 2 additions & 2 deletions src/libcrun/criu.c
Original file line number Diff line number Diff line change
Expand Up @@ -802,11 +802,11 @@ libcrun_container_restore_linux_criu (libcrun_container_status_t *status, libcru
* recording the destination of FD 0, 1 and 2. */
json_array_foreach(tree ,index, value)
{
if (value && YAJL_IS_STRING (value))
if (value && json_is_string (value))
{
char *str = json_string_Value (value);
if (has_prefix (str, "pipe:"))
libcriu_wrapper->criu_add_inherit_fd (i, str);
libcriu_wrapper->criu_add_inherit_fd (index, str);
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/libcrun/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
# include <systemd/sd-journal.h>
#endif

#define YAJL_STR(x) ((const unsigned char *) (x))

enum
{
LOG_FORMAT_TEXT = 0,
Expand Down
2 changes: 0 additions & 2 deletions src/libcrun/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@

#include "mount_flags.h"

#define YAJL_STR(x) ((const unsigned char *) (x))

#ifndef RLIMIT_RTTIME
# define RLIMIT_RTTIME 15
#endif
Expand Down
2 changes: 0 additions & 2 deletions src/libcrun/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
#include <dirent.h>
#include <signal.h>

#define YAJL_STR(x) ((const unsigned char *) (x))

struct pid_stat
{
char state;
Expand Down
2 changes: 1 addition & 1 deletion tests/alpine-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine

RUN apk add gcc automake autoconf libtool gettext pkgconf git make musl-dev \
python3 libcap-dev libseccomp-dev yajl-dev argp-standalone go-md2man
python3 libcap-dev libseccomp-dev jansson-dev argp-standalone go-md2man

COPY run-tests.sh /usr/local/bin

Expand Down
2 changes: 1 addition & 1 deletion tests/centos8-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM quay.io/centos/centos:stream8

RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && \
yum --enablerepo='powertools' install -y make automake autoconf gettext \
criu-devel libtool gcc libcap-devel systemd-devel yajl-devel \
criu-devel libtool gcc libcap-devel systemd-devel jansson-devel \
libseccomp-devel python36 libtool git

COPY run-tests.sh /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion tests/centos9-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM quay.io/centos/centos:stream9

RUN yum --enablerepo='appstream' --enablerepo='baseos' --enablerepo='crb' install -y make \
automake autoconf gettext criu-devel libtool gcc libcap-devel systemd-devel yajl-devel \
automake autoconf gettext criu-devel libtool gcc libcap-devel systemd-devel jansson-devel \
libseccomp-devel python3 libtool git protobuf-c protobuf-c-devel

COPY run-tests.sh /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion tests/containerd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN apt-get update \
protobuf-c-compiler libcap-dev libaio-dev \
curl libprotobuf-c-dev libprotobuf-dev socat libseccomp-dev \
pigz lsof make git gcc build-essential pkgconf libtool \
libsystemd-dev libcap-dev libyajl-dev \
libsystemd-dev libcap-dev libjansson-dev \
go-md2man libtool autoconf python3 automake sudo \
&& update-alternatives --install /usr/bin/go go /usr/lib/go-1.22/bin/go 0 \
&& mkdir -p /root/go/src/github.com/containerd \
Expand Down
2 changes: 1 addition & 1 deletion tests/cri-o/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV GOPATH=/root/go
ENV PATH=/usr/bin:/usr/sbin:/root/go/bin:/usr/local/bin::/usr/local/sbin

RUN yum install -y python git gcc automake autoconf libcap-devel \
systemd-devel yajl-devel libseccomp-devel go-md2man conntrack-tools which \
systemd-devel jansson-devel libseccomp-devel go-md2man conntrack-tools which \
glibc-static python3-libmount libtool make podman xz nmap-ncat jq bats \
iproute openssl iputils socat criu-libs irqbalance && \
dnf install -y 'dnf-command(builddep)' && dnf builddep -y podman && \
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzzing/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM fedora:latest

RUN yum install -y golang python git automake autoconf libcap-devel \
systemd-devel yajl-devel libseccomp-devel go-md2man \
systemd-devel jansson-devel libseccomp-devel go-md2man \
glibc-static python3-libmount libtool make honggfuzz git

RUN git clone https://github.com/giuseppe/containers-fuzzing-corpus /testcases
Expand Down
2 changes: 1 addition & 1 deletion tests/oci-validation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV GOPATH=/root/go
ENV PATH=/usr/bin:/usr/sbin:/root/go/bin:/usr/local/bin::/usr/local/sbin

RUN yum install -y golang python git gcc automake autoconf libcap-devel \
systemd-devel yajl-devel libseccomp-devel libselinux-devel \
systemd-devel jansson-devel libseccomp-devel libselinux-devel \
glibc-static python3-libmount libtool make go-md2man perl-Test2-Harness

COPY run-tests.sh /usr/local/bin
Expand Down
2 changes: 1 addition & 1 deletion tests/podman/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ENV GOPATH=/root/go
ENV PATH=/usr/bin:/usr/sbin:/root/go/bin:/usr/local/bin::/usr/local/sbin

RUN dnf install -y golang python git gcc automake autoconf libcap-devel \
systemd-devel yajl-devel libseccomp-devel go-md2man \
systemd-devel jansson-devel libseccomp-devel go-md2man \
glibc-static python3-libmount libtool make podman xz nmap-ncat procps-ng slirp4netns \
device-mapper-devel containernetworking-plugins 'dnf-command(builddep)' && \
dnf builddep -y podman && \
Expand Down
4 changes: 2 additions & 2 deletions tests/wasmedge-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ ARG WASM_EDGE_VERSION="0.14.0"

# Install the deps for building crun
RUN dnf update -y && dnf install -y make python git gcc automake autoconf libcap-devel \
systemd-devel yajl-devel libseccomp-devel pkg-config diffutils \
systemd-devel yajl-devel libseccomp-devel pkg-config \
systemd-devel jansson-devel libseccomp-devel pkg-config diffutils \
systemd-devel libseccomp-devel pkg-config \
go-md2man glibc-static python3-libmount libtool buildah podman which

# Install WasmEdge
Expand Down

0 comments on commit 7e02bc2

Please sign in to comment.