Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit b548fbb

Browse files
committed
remove unused PODFINISHED
Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
1 parent 5b33d7a commit b548fbb

File tree

4 files changed

+12
-34
lines changed

4 files changed

+12
-34
lines changed

src/api.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
enum {
88
GETVERSION,
99
STARTPOD,
10-
GETPOD,
10+
GETPOD_DEPRECATED,
1111
STOPPOD_DEPRECATED,
1212
DESTROYPOD,
13-
RESTARTCONTAINER,
13+
RESTARTCONTAINER_DEPRECATED,
1414
EXECCMD,
15-
CMDFINISHED,
15+
CMDFINISHED_DEPRECATED,
1616
READY,
1717
ACK,
1818
ERROR,
1919
WINSIZE,
2020
PING,
21-
PODFINISHED,
21+
PODFINISHED_DEPRECATED,
2222
NEXT,
2323
WRITEFILE,
2424
READFILE,

src/exec.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,6 @@ static int hyper_release_exec(struct hyper_exec *exec)
703703
if (exec->pod->req_destroy) {
704704
/* shutdown vm manually, hyper doesn't care the pod finished codes */
705705
hyper_pod_destroyed(0);
706-
} else {
707-
/* send out pod finish message, hyper will decide if restart pod or not */
708-
hyper_send_pod_finished(exec->pod);
709706
}
710707

711708
hyper_cleanup_pod(exec->pod);

src/hyper.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ int hyper_open_serial(char *tty);
8585
void hyper_cleanup_pod(struct hyper_pod *pod);
8686
int hyper_enter_sandbox(struct hyper_pod *pod, int pidpipe);
8787
void hyper_pod_destroyed(int failed);
88-
int hyper_send_pod_finished(struct hyper_pod *pod);
8988

9089
extern struct hyper_pod global_pod;
9190
extern struct hyper_epoll hyper_epoll;

src/init.c

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,6 @@ sigset_t orig_mask;
4444
static int hyper_handle_exit(struct hyper_pod *pod);
4545
static int hyper_ctl_append_msg(struct hyper_event *he, uint32_t type, uint8_t *data, uint32_t len);
4646

47-
int hyper_send_pod_finished(struct hyper_pod *pod)
48-
{
49-
struct hyper_container *c;
50-
uint8_t *data = NULL, *new;
51-
int c_num = 0;
52-
53-
list_for_each_entry(c, &pod->containers, list) {
54-
c_num++;
55-
new = realloc(data, c_num * 4);
56-
if (new == NULL) {
57-
free(data);
58-
return -1;
59-
}
60-
61-
hyper_set_be32(new + ((c_num - 1) * 4), c->exec.code);
62-
data = new;
63-
}
64-
65-
return hyper_ctl_append_msg(&hyper_epoll.ctl, PODFINISHED, data, c_num * 4);
66-
}
67-
6847
static int hyper_set_win_size(char *json, int length)
6948
{
7049
struct winsize size;
@@ -1118,10 +1097,6 @@ static int hyper_ctlmsg_handle(struct hyper_event *he, uint32_t len)
11181097
ret = hyper_start_pod((char *)buf->data + 8, len - 8);
11191098
hyper_print_uptime();
11201099
break;
1121-
case STOPPOD_DEPRECATED:
1122-
fprintf(stderr, "get abandoned STOPPOD message\n");
1123-
ret = -1;
1124-
break;
11251100
case DESTROYPOD:
11261101
pod->req_destroy = 1;
11271102
fprintf(stdout, "get DESTROYPOD message\n");
@@ -1137,7 +1112,6 @@ static int hyper_ctlmsg_handle(struct hyper_event *he, uint32_t len)
11371112
ret = hyper_cmd_rw_file((char *)buf->data + 8, len - 8, &datalen, &data, READFILE);
11381113
break;
11391114
case PING:
1140-
case GETPOD:
11411115
break;
11421116
case READY:
11431117
ret = hyper_rescan();
@@ -1163,6 +1137,14 @@ static int hyper_ctlmsg_handle(struct hyper_event *he, uint32_t len)
11631137
case SETUPROUTE:
11641138
ret = hyper_cmd_setup_route((char *)buf->data + 8, len - 8);
11651139
break;
1140+
case GETPOD_DEPRECATED:
1141+
case STOPPOD_DEPRECATED:
1142+
case RESTARTCONTAINER_DEPRECATED:
1143+
case CMDFINISHED_DEPRECATED:
1144+
case PODFINISHED_DEPRECATED:
1145+
fprintf(stderr, "get abandoned command\n");
1146+
ret = -1;
1147+
break;
11661148
default:
11671149
ret = -1;
11681150
break;

0 commit comments

Comments
 (0)