Lines Matching refs:v
81 static int oci_unexpected(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata… in oci_unexpected() argument
82 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_unexpected()
83 …expected OCI element '%s' of type '%s'.", name, json_variant_type_to_string(json_variant_type(v))); in oci_unexpected()
86 static int oci_unsupported(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdat… in oci_unsupported() argument
87 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_unsupported()
88 …upported OCI element '%s' of type '%s'.", name, json_variant_type_to_string(json_variant_type(v))); in oci_unsupported()
91 static int oci_terminal(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_terminal() argument
96 s->console_mode = json_variant_boolean(v) ? _CONSOLE_MODE_INVALID : CONSOLE_PIPE; in oci_terminal()
118 static int oci_console_size(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_console_size() argument
126 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_console_size()
129 static int oci_absolute_path(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userd… in oci_absolute_path() argument
135 n = json_variant_string(v); in oci_absolute_path()
138 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_absolute_path()
144 static int oci_env(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_env() argument
151 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_env()
172 static int oci_args(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_args() argument
179 r = json_variant_strv(v, &l); in oci_args()
181 return json_log(v, flags, r, "Cannot parse arguments as list of strings: %m"); in oci_args()
184 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_args()
188 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_args()
194 static int oci_rlimit_type(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdat… in oci_rlimit_type() argument
200 z = startswith(json_variant_string(v), "RLIMIT_"); in oci_rlimit_type()
202 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_rlimit_type()
204 json_variant_string(v)); in oci_rlimit_type()
208 return json_log(v, flags, t, in oci_rlimit_type()
209 "rlimit name unknown: %s", json_variant_string(v)); in oci_rlimit_type()
215 static int oci_rlimit_value(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_rlimit_value() argument
220 if (json_variant_is_negative(v)) in oci_rlimit_value()
223 if (!json_variant_is_unsigned(v)) in oci_rlimit_value()
224 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_rlimit_value()
227 z = (rlim_t) json_variant_unsigned(v); in oci_rlimit_value()
229 if ((uint64_t) z != json_variant_unsigned(v)) in oci_rlimit_value()
230 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_rlimit_value()
238 static int oci_rlimits(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_rlimits() argument
246 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_rlimits()
273 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_rlimits()
289 static int oci_capability_array(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *us… in oci_capability_array() argument
293 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_capability_array()
298 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_capability_array()
305 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_capability_array()
319 static int oci_capabilities(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_capabilities() argument
335 r = json_dispatch(v, table, oci_unexpected, flags, &s->full_capabilities); in oci_capabilities()
347 static int oci_oom_score_adj(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userd… in oci_oom_score_adj() argument
353 k = json_variant_integer(v); in oci_oom_score_adj()
355 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_oom_score_adj()
364 static int oci_uid_gid(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_uid_gid() argument
371 k = json_variant_unsigned(v); in oci_uid_gid()
374 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_uid_gid()
378 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_uid_gid()
385 static int oci_supplementary_gids(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *… in oci_supplementary_gids() argument
392 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_supplementary_gids()
396 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_supplementary_gids()
414 static int oci_user(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_user() argument
422 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_user()
425 static int oci_process(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_process() argument
443 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_process()
446 static int oci_root(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_root() argument
456 r = json_dispatch(v, table, oci_unexpected, flags, s); in oci_root()
473 static int oci_hostname(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_hostname() argument
479 assert_se(n = json_variant_string(v)); in oci_hostname()
482 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_hostname()
540 static int oci_mounts(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_mounts() argument
547 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_mounts()
605 static int oci_namespace_type(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *user… in oci_namespace_type() argument
610 assert_se(n = json_variant_string(v)); in oci_namespace_type()
629 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_namespace_type()
635 static int oci_namespaces(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata… in oci_namespaces() argument
643 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_namespaces()
687 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_namespaces()
699 static int oci_uid_gid_range(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userd… in oci_uid_gid_range() argument
710 k = json_variant_unsigned(v); in oci_uid_gid_range()
713 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_uid_gid_range()
716 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_uid_gid_range()
723 static int oci_uid_gid_mappings(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *us… in oci_uid_gid_mappings() argument
747 if (json_variant_elements(v) == 0) in oci_uid_gid_mappings()
750 if (json_variant_elements(v) > 1) in oci_uid_gid_mappings()
751 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_uid_gid_mappings()
754 assert_se(e = json_variant_by_index(v, 0)); in oci_uid_gid_mappings()
762 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_uid_gid_mappings()
766 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_uid_gid_mappings()
770 json_log(v, flags|JSON_WARNING, 0, in oci_uid_gid_mappings()
775 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_uid_gid_mappings()
784 static int oci_device_type(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdat… in oci_device_type() argument
789 assert_se(t = json_variant_string(v)); in oci_device_type()
798 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_device_type()
804 static int oci_device_major(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_device_major() argument
810 k = json_variant_unsigned(v); in oci_device_major()
812 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_device_major()
819 static int oci_device_minor(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_device_minor() argument
825 k = json_variant_unsigned(v); in oci_device_minor()
827 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_device_minor()
834 static int oci_device_file_mode(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *us… in oci_device_file_mode() argument
840 k = json_variant_unsigned(v); in oci_device_file_mode()
844 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_device_file_mode()
851 static int oci_devices(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_devices() argument
858 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_devices()
936 static int oci_cgroups_path(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_cgroups_path() argument
944 assert_se(p = json_variant_string(v)); in oci_cgroups_path()
948 … return json_log(v, flags, r, "Couldn't derive slice unit name from path '%s': %m", p); in oci_cgroups_path()
952 … return json_log(v, flags, r, "Couldn't convert slice unit name '%s' back to path: %m", slice); in oci_cgroups_path()
955 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_cgroups_path()
962 static int oci_cgroup_device_type(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *… in oci_cgroup_device_type() argument
966 assert_se(n = json_variant_string(v)); in oci_cgroup_device_type()
973 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_cgroup_device_type()
989 static int oci_cgroup_device_access(const char *name, JsonVariant *v, JsonDispatchFlags flags, void… in oci_cgroup_device_access() argument
995 assert_se(s = json_variant_string(v)); in oci_cgroup_device_access()
1005 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_cgroup_device_access()
1015 static int oci_cgroup_devices(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *user… in oci_cgroup_devices() argument
1026 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_cgroup_devices()
1056 …json_log(v, flags|JSON_WARNING, 0, "Devices cgroup allow list with arbitrary 'allow' entries not s… in oci_cgroup_devices()
1063 …json_log(v, flags|LOG_WARNING, 0, "Device cgroup allow list entry with no effect found, ignoring."… in oci_cgroup_devices()
1068 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_cgroup_devices()
1072 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_cgroup_devices()
1079 return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), in oci_cgroup_devices()
1176 static int oci_cgroup_memory_limit(const char *name, JsonVariant *v, JsonDispatchFlags flags, void … in oci_cgroup_memory_limit() argument
1182 if (json_variant_is_negative(v)) { in oci_cgroup_memory_limit()
1187 if (!json_variant_is_unsigned(v)) in oci_cgroup_memory_limit()
1188 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_cgroup_memory_limit()
1191 k = json_variant_unsigned(v); in oci_cgroup_memory_limit()
1193 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_cgroup_memory_limit()
1200 static int oci_cgroup_memory(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userd… in oci_cgroup_memory() argument
1226 r = json_dispatch(v, table, oci_unexpected, flags, &data); in oci_cgroup_memory()
1232 … json_log(v, flags|LOG_WARNING, 0, "swap limit without memory limit is not supported, ignoring."); in oci_cgroup_memory()
1234 … json_log(v, flags|LOG_WARNING, 0, "swap limit is below memory limit, ignoring."); in oci_cgroup_memory()
1276 static int oci_cgroup_cpu_shares(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *u… in oci_cgroup_cpu_shares() argument
1282 k = json_variant_unsigned(v); in oci_cgroup_cpu_shares()
1284 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_cgroup_cpu_shares()
1291 static int oci_cgroup_cpu_quota(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *us… in oci_cgroup_cpu_quota() argument
1297 k = json_variant_unsigned(v); in oci_cgroup_cpu_quota()
1299 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_cgroup_cpu_quota()
1306 static int oci_cgroup_cpu_cpus(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *use… in oci_cgroup_cpu_cpus() argument
1314 assert_se(n = json_variant_string(v)); in oci_cgroup_cpu_cpus()
1318 return json_log(v, flags, r, "Failed to parse CPU set specification: %s", n); in oci_cgroup_cpu_cpus()
1326 static int oci_cgroup_cpu(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata… in oci_cgroup_cpu() argument
1348 r = json_dispatch(v, table, oci_unexpected, flags, &data); in oci_cgroup_cpu()
1377 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_cgroup_cpu()
1383 static int oci_cgroup_block_io_weight(const char *name, JsonVariant *v, JsonDispatchFlags flags, vo… in oci_cgroup_block_io_weight() argument
1390 k = json_variant_unsigned(v); in oci_cgroup_block_io_weight()
1392 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_cgroup_block_io_weight()
1406 static int oci_cgroup_block_io_weight_device(const char *name, JsonVariant *v, JsonDispatchFlags fl… in oci_cgroup_block_io_weight_device() argument
1413 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_cgroup_block_io_weight_device()
1442 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_cgroup_block_io_weight_device()
1447 return json_log(v, flags, r, "Failed to build device path: %m"); in oci_cgroup_block_io_weight_device()
1461 static int oci_cgroup_block_io_throttle(const char *name, JsonVariant *v, JsonDispatchFlags flags, … in oci_cgroup_block_io_throttle() argument
1474 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_cgroup_block_io_throttle()
1498 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_cgroup_block_io_throttle()
1503 return json_log(v, flags, r, "Failed to build device path: %m"); in oci_cgroup_block_io_throttle()
1517 static int oci_cgroup_block_io(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *use… in oci_cgroup_block_io() argument
1530 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_cgroup_block_io()
1533 static int oci_cgroup_pids(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdat… in oci_cgroup_pids() argument
1547 r = json_dispatch(v, table, oci_unexpected, flags, &k); in oci_cgroup_pids()
1561 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_cgroup_pids()
1576 static int oci_resources(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata)… in oci_resources() argument
1590 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_resources()
1624 static int oci_sysctl(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_sysctl() argument
1632 JSON_VARIANT_OBJECT_FOREACH(k, w, v) { in oci_sysctl()
1636 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_sysctl()
1642 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_sysctl()
1760 static int oci_seccomp_archs(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userd… in oci_seccomp_archs() argument
1767 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_seccomp_archs()
1802 static int oci_seccomp_action(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *user… in oci_seccomp_action() argument
1808 r = oci_seccomp_action_from_string(json_variant_string(v), action); in oci_seccomp_action()
1810 … return json_log(v, flags, r, "Unknown system call action '%s': %m", json_variant_string(v)); in oci_seccomp_action()
1815 static int oci_seccomp_op(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata… in oci_seccomp_op() argument
1821 r = oci_seccomp_compare_from_string(json_variant_string(v), op); in oci_seccomp_op()
1823 … return json_log(v, flags, r, "Unknown seccomp operator '%s': %m", json_variant_string(v)); in oci_seccomp_op()
1828 static int oci_seccomp_args(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_seccomp_args() argument
1835 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_seccomp_args()
1879 static int oci_seccomp_syscalls(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *us… in oci_seccomp_syscalls() argument
1886 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_seccomp_syscalls()
1932 static int oci_seccomp(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_seccomp() argument
1950 def = json_variant_by_key(v, "defaultAction"); in oci_seccomp()
1952 … return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), "defaultAction element missing."); in oci_seccomp()
1963 … return json_log(v, flags, SYNTHETIC_ERRNO(ENOMEM), "Couldn't allocate seccomp object."); in oci_seccomp()
1965 r = json_dispatch(v, table, oci_unexpected, flags, sc); in oci_seccomp()
1973 …return json_log(v, flags, SYNTHETIC_ERRNO(EOPNOTSUPP), "libseccomp support not enabled, can't pars… in oci_seccomp()
1977 static int oci_rootfs_propagation(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *… in oci_rootfs_propagation() argument
1980 s = json_variant_string(v); in oci_rootfs_propagation()
1985 json_log(v, flags|JSON_DEBUG, 0, "Ignoring rootfsPropagation setting '%s'.", s); in oci_rootfs_propagation()
1989 static int oci_masked_paths(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_masked_paths() argument
1995 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_masked_paths()
2001 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_masked_paths()
2007 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_masked_paths()
2031 static int oci_readonly_paths(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *user… in oci_readonly_paths() argument
2037 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_readonly_paths()
2043 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_readonly_paths()
2049 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_readonly_paths()
2075 static int oci_linux(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_linux() argument
2094 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_linux()
2097 static int oci_hook_timeout(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userda… in oci_hook_timeout() argument
2101 k = json_variant_unsigned(v); in oci_hook_timeout()
2103 return json_log(v, flags, SYNTHETIC_ERRNO(ERANGE), in oci_hook_timeout()
2110 static int oci_hooks_array(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdat… in oci_hooks_array() argument
2117 JSON_VARIANT_ARRAY_FOREACH(e, v) { in oci_hooks_array()
2167 static int oci_hooks(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdata) { in oci_hooks() argument
2176 return json_dispatch(v, table, oci_unexpected, flags, userdata); in oci_hooks()
2179 static int oci_annotations(const char *name, JsonVariant *v, JsonDispatchFlags flags, void *userdat… in oci_annotations() argument
2183 JSON_VARIANT_OBJECT_FOREACH(k, w, v) { in oci_annotations()
2186 return json_log(v, flags, SYNTHETIC_ERRNO(EINVAL), in oci_annotations()
2216 JsonVariant *v; in oci_load() local
2232 v = json_variant_by_key(oci, "ociVersion"); in oci_load()
2233 if (!v) in oci_load()
2237 if (!streq_ptr(json_variant_string(v), "1.0.0")) in oci_load()
2240 strna(json_variant_string(v))); in oci_load()