diff --git a/lcr.spec b/lcr.spec index 3a55bb0..4750177 100644 --- a/lcr.spec +++ b/lcr.spec @@ -1,5 +1,5 @@ %global _version 2.0.0 -%global _release 20200418.180849.git0944f121 +%global _release 20200418.180709.gitaabdb4e4 Name: lcr Version: %{_version} Release: %{_release} diff --git a/src/conf.c b/src/conf.c index cdf0b73..593cd61 100644 --- a/src/conf.c +++ b/src/conf.c @@ -182,28 +182,6 @@ static int check_cgroup_dir(const char *value) return 0; } -static int check_empty_value(const char *value) -{ - if (value == NULL || strlen(value) == 0) { - return -1; - } - return 0; -} - -static int check_console_log_driver(const char *value) -{ - if (value == NULL || strlen(value) == 0) { - return -1; - } - if (strcmp(value, "syslog") == 0) { - return 0; - } - if (strcmp(value, "json-file") == 0) { - return 0; - } - return -1; -} - static const lcr_annotation_item_t g_require_annotations[] = { { "files.limit", @@ -225,21 +203,6 @@ static const lcr_annotation_item_t g_require_annotations[] = { "lxc.console.rotate", check_console_log_filerotate, }, - { - "log.console.driver", - "lxc.console.logdriver", - check_console_log_driver, - }, - { - "log.console.tag", - "lxc.console.syslog_tag", - check_empty_value, - }, - { - "log.console.facility", - "lxc.console.syslog_facility", - check_empty_value, - }, { "rootfs.mount", "lxc.rootfs.mount", diff --git a/src/lcrcontainer.c b/src/lcrcontainer.c index 160d20d..c6ddf6b 100644 --- a/src/lcrcontainer.c +++ b/src/lcrcontainer.c @@ -270,22 +270,6 @@ out_free: free(path); } -bool lcr_create_from_ocidata(const char *name, const char *lcrpath, const void *oci_json_data) -{ - oci_runtime_spec *oci_spec = NULL; - bool ret = true; - - if (!container_parse(NULL, oci_json_data, &oci_spec)) { - ret = false; - goto out_free; - } - - ret = lcr_create(name, lcrpath, oci_spec); -out_free: - free_oci_runtime_spec(oci_spec); - return ret; -} - static bool lcr_create_spec(struct lxc_container *c, oci_runtime_spec *oci_spec) { // Translate oci config diff --git a/src/lcrcontainer.h b/src/lcrcontainer.h index 673afa4..2132a33 100644 --- a/src/lcrcontainer.h +++ b/src/lcrcontainer.h @@ -139,17 +139,10 @@ void lcr_containers_info_free(struct lcr_container_info **info_arr, size_t size) /* * Create a container - * param name : container name - * param lcrpath : container path - * param oci_json_data : json string of oci config data - */ -bool lcr_create_from_ocidata(const char *name, const char *lcrpath, const void *oci_json_data); - -/* - * Create a container - * param name : container name - * param lcrpath : container path - * param oci_config : pointer of struct oci config + * param name : container name + * param lcrpath: container path + * param rootfs : the path of rootfs used for the container + * param oci_config_data : json string of oci config data */ bool lcr_create(const char *name, const char *lcrpath, void *oci_config); diff --git a/src/lcrcontainer_extend.c b/src/lcrcontainer_extend.c index 46e9324..d2f5786 100644 --- a/src/lcrcontainer_extend.c +++ b/src/lcrcontainer_extend.c @@ -821,7 +821,6 @@ static int lcr_spec_write_config(int fd, const struct lcr_list *lcr_conf) } nret = snprintf(line, len, "%s = %s", item->name, item->value); - if (nret < 0 || (size_t)nret >= len) { ERROR("Sprintf failed"); goto cleanup;