diff --git a/src/daemon/executor/container_cb/execution_stream.c b/src/daemon/executor/container_cb/execution_stream.c index ed3913b7181148c8a81b9c2b822a827f115f9a77..6a35c4fd7404407fbf5d01839ec4191fec5df2c3 100644 --- a/src/daemon/executor/container_cb/execution_stream.c +++ b/src/daemon/executor/container_cb/execution_stream.c @@ -47,6 +47,13 @@ #include "container_operator.h" #include "io_handler.h" +struct container_log_config { + char *driver; + char *path; + int rotate; + int64_t size; +}; + static int do_append_process_exec_env(const char **default_env, defs_process *spec) { int ret = 0; @@ -295,8 +302,7 @@ err_out: return NULL; } -static int exec_container(container_t *cont, const char *runtime, char * const console_fifos[], - defs_process_user *puser, +static int exec_container(container_t *cont, const char *runtime, char * const console_fifos[], defs_process_user *puser, const container_exec_request *request, int *exit_code) { int ret = 0; @@ -2055,6 +2061,20 @@ static bool support_logs(struct container_log_config *log_config) return true; } +static void container_log_config_free(struct container_log_config *conf) +{ + if (conf == NULL) { + return; + } + free(conf->path); + conf->path = NULL; + free(conf->driver); + conf->driver = NULL; + conf->rotate = 0; + conf->size = 0; + free(conf); +} + static int container_logs_cb(const struct isulad_logs_request *request, stream_func_wrapper *stream, struct isulad_logs_response **response) { diff --git a/src/daemon/libisulad.c b/src/daemon/libisulad.c index 204a0199dca1a7af2a074443a780daadbd8af0a8..65cda67a699e7b333b8b017153db1196455e6dbf 100644 --- a/src/daemon/libisulad.c +++ b/src/daemon/libisulad.c @@ -233,20 +233,6 @@ void isulad_logs_response_free(struct isulad_logs_response *response) free(response); } -void container_log_config_free(struct container_log_config *conf) -{ - if (conf == NULL) { - return; - } - free(conf->path); - conf->path = NULL; - free(conf->driver); - conf->driver = NULL; - conf->rotate = 0; - conf->size = 0; - free(conf); -} - /* events copy */ int event_copy(const struct isulad_events_format *src, struct isulad_events_format *dest) { diff --git a/src/daemon/libisulad.h b/src/daemon/libisulad.h index aab743519e926ff2687704dce3cde4093c94f9fb..b59edf6d6e276401c3ff96da62753eae1b5d01e2 100644 --- a/src/daemon/libisulad.h +++ b/src/daemon/libisulad.h @@ -199,35 +199,6 @@ struct isulad_container_resize_response { char *errmsg; }; -struct isulad_image_info { - char *imageref; - char *type; - char *digest; - int64_t created; /* seconds */ - int32_t created_nanos; - int64_t size; /* Bytes */ -}; - -struct isulad_create_image_request { - struct isulad_image_info image_info; -}; - -struct isulad_create_image_response { - uint32_t cc; - uint32_t server_errono; - struct isulad_image_info image_info; - char *errmsg; -}; - -struct container_log_config { - char *driver; - char *path; - int rotate; - int64_t size; -}; - -void container_log_config_free(struct container_log_config *conf); - void isulad_events_request_free(struct isulad_events_request *request); void isulad_copy_from_container_request_free(struct isulad_copy_from_container_request *request);