!18 sync with openeuler on 04.27

Merge pull request !18 from Grooooot/license_stable2.0.0
This commit is contained in:
openeuler-ci-bot 2020-04-27 10:46:48 +08:00 committed by Gitee
commit 4045b257a3
5 changed files with 5 additions and 66 deletions

View File

@ -1,5 +1,5 @@
%global _version 2.0.0 %global _version 2.0.0
%global _release 20200418.180849.git0944f121 %global _release 20200418.180709.gitaabdb4e4
Name: lcr Name: lcr
Version: %{_version} Version: %{_version}
Release: %{_release} Release: %{_release}

View File

@ -182,28 +182,6 @@ static int check_cgroup_dir(const char *value)
return 0; 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[] = { static const lcr_annotation_item_t g_require_annotations[] = {
{ {
"files.limit", "files.limit",
@ -225,21 +203,6 @@ static const lcr_annotation_item_t g_require_annotations[] = {
"lxc.console.rotate", "lxc.console.rotate",
check_console_log_filerotate, 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", "rootfs.mount",
"lxc.rootfs.mount", "lxc.rootfs.mount",

View File

@ -270,22 +270,6 @@ out_free:
free(path); 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) static bool lcr_create_spec(struct lxc_container *c, oci_runtime_spec *oci_spec)
{ {
// Translate oci config // Translate oci config

View File

@ -140,16 +140,9 @@ void lcr_containers_info_free(struct lcr_container_info **info_arr, size_t size)
/* /*
* Create a container * Create a container
* param name : container name * param name : container name
* param lcrpath : container path * param lcrpath: container path
* param oci_json_data : json string of oci config data * param rootfs : the path of rootfs used for the container
*/ * param oci_config_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
*/ */
bool lcr_create(const char *name, const char *lcrpath, void *oci_config); bool lcr_create(const char *name, const char *lcrpath, void *oci_config);

View File

@ -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); nret = snprintf(line, len, "%s = %s", item->name, item->value);
if (nret < 0 || (size_t)nret >= len) { if (nret < 0 || (size_t)nret >= len) {
ERROR("Sprintf failed"); ERROR("Sprintf failed");
goto cleanup; goto cleanup;