Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ void hyper_event_hup(struct hyper_event *he, int efd)
int hyper_handle_event(int efd, struct epoll_event *event)
{
struct hyper_event *he = event->data.ptr;
fprintf(stdout, "%s get event %d, he %p, fd %d. ops %p\n",
__func__, event->events, he, he->fd, he->ops);

/* do not handle hup event if have in/out event */
if ((event->events & EPOLLIN) && he->ops->read) {
Expand Down
5 changes: 0 additions & 5 deletions src/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ struct hyper_exec *hyper_find_exec_by_pid(struct list_head *head, int pid)
struct hyper_exec *exec;

list_for_each_entry(exec, head, list) {
fprintf(stdout, "exec pid %d, pid %d\n", exec->pid, pid);
if (exec->pid != pid)
continue;

Expand All @@ -752,8 +751,6 @@ struct hyper_exec *hyper_find_exec_by_seq(struct hyper_pod *pod, uint64_t seq)
struct hyper_exec *exec;

list_for_each_entry(exec, &pod->exec_head, list) {
fprintf(stdout, "exec seq %" PRIu64 ", seq %" PRIu64 "\n",
exec->seq, seq);
if (exec->seq != seq)
continue;

Expand Down Expand Up @@ -821,8 +818,6 @@ int hyper_handle_exec_exit(struct hyper_pod *pod, int pid, uint8_t code)

exec = hyper_find_exec_by_pid(&pod->exec_head, pid);
if (exec == NULL) {
fprintf(stdout, "can not find exec whose pid is %d\n",
pid);
return 0;
}

Expand Down
11 changes: 3 additions & 8 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,16 +1086,14 @@ static int hyper_ctlmsg_handle(struct hyper_event *he, uint32_t len)
struct hyper_pod *pod = he->ptr;
uint32_t type = 0, datalen = 0;
uint8_t *data = NULL;
int i, ret = 0;
int ret = 0;

// append a null byte to it. hyper_ctlfd_read() left this room for us.
buf->data[buf->get] = 0;
for (i = 0; i < buf->get; i++)
fprintf(stdout, "%0x ", buf->data[i]);

type = hyper_get_be32(buf->data);

fprintf(stdout, "\n %s, type %" PRIu32 ", len %" PRIu32 "\n",
fprintf(stdout, "%s, type %" PRIu32 ", len %" PRIu32 "\n",
__func__, type, len);

switch (type) {
Expand Down Expand Up @@ -1171,8 +1169,6 @@ static int hyper_ctlfd_read(struct hyper_event *he, int efd, int events)
int size;
int ret;

fprintf(stdout, "%s\n", __func__);

if (buf->get < CONTROL_HEADER_SIZE) {
size = hyper_channel_read(he, efd, CONTROL_HEADER_SIZE - buf->get, events);
if (size < 0) {
Expand All @@ -1191,7 +1187,7 @@ static int hyper_ctlfd_read(struct hyper_event *he, int efd, int events)
}

len = hyper_get_be32(buf->data + CONTROL_HEADER_LENGTH_OFFSET);
fprintf(stdout, "get length %" PRIu32"\n", len);
fprintf(stdout, "%s: get length %" PRIu32"\n", __func__, len);
// test it with '>=' to leave at least one byte in hyper_ctlfd_handle(),
// so that hyper_ctlfd_handle() can convert the data to c-string inplace.
if (len >= buf->size) {
Expand Down Expand Up @@ -1336,7 +1332,6 @@ static int hyper_loop(void)
perror("hyper wait event failed");
return -1;
}
fprintf(stdout, "%s epoll_wait %d\n", __func__, n);

for (i = 0; i < n; i++) {
if (hyper_handle_event(hyper_epoll.efd, &events[i]) < 0)
Expand Down