diff --git a/src/api.h b/src/api.h index 876351c..c20c131 100644 --- a/src/api.h +++ b/src/api.h @@ -7,7 +7,7 @@ enum { GETVERSION, STARTPOD, GETPOD, - STOPPOD, + STOPPOD_DEPRECATED, DESTROYPOD, RESTARTCONTAINER, EXECCMD, diff --git a/src/exec.c b/src/exec.c index 0f13e0b..8ee3f52 100644 --- a/src/exec.c +++ b/src/exec.c @@ -729,10 +729,7 @@ static int hyper_release_exec(struct hyper_exec *exec, if (--pod->remains > 0) return 0; - if (pod->type == STOPPOD) { - /* stop pod manually, hyper doesn't care the pod finished codes */ - hyper_send_msg_block(ctl.chan.fd, ACK, 0, NULL); - } else if (pod->type == DESTROYPOD) { + if (pod->type == DESTROYPOD) { /* shutdown vm manually, hyper doesn't care the pod finished codes */ hyper_shutdown(0); } else { diff --git a/src/init.c b/src/init.c index fabf096..38edfe9 100644 --- a/src/init.c +++ b/src/init.c @@ -41,7 +41,6 @@ struct hyper_ctl ctl; sigset_t orig_mask; static int hyper_handle_exit(struct hyper_pod *pod); -static int hyper_stop_pod(struct hyper_pod *pod); static int hyper_set_win_size(char *json, int length) { @@ -327,9 +326,6 @@ static int hyper_setup_pod_init(struct hyper_pod *pod) out: close(arg.ctl_pipe[1]); close(arg.ctl_pipe[0]); - if (ret < 0) { - hyper_stop_pod(pod); - } return ret; } @@ -938,20 +934,6 @@ void hyper_cleanup_pod(struct hyper_pod *pod) hyper_cleanup_hostname(pod); } -static int hyper_stop_pod(struct hyper_pod *pod) -{ - fprintf(stdout, "hyper_stop_pod init_pid %d\n", pod->init_pid); - if (pod->init_pid == 0) { - fprintf(stdout, "container init pid is already exit\n"); - hyper_send_type(ctl.chan.fd, ACK); - return 0; - } - - pod->init_pid = 0; - hyper_term_all(pod); - return 0; -} - static int hyper_setup_ctl_channel(char *name) { int ret = hyper_open_channel(name, 0); @@ -1084,10 +1066,10 @@ static int hyper_channel_handle(struct hyper_event *de, uint32_t len) ret = hyper_start_pod((char *)buf->data + 8, len - 8); hyper_print_uptime(); break; - case STOPPOD: - hyper_stop_pod(pod); - return 0; - //break; + case STOPPOD_DEPRECATED: + fprintf(stderr, "get abandoned STOPPOD message\n"); + ret = -1; + break; case DESTROYPOD: fprintf(stdout, "get DESTROYPOD message\n"); hyper_destroy_pod(pod, 0);