diff --git a/src/hyper.h b/src/hyper.h index 215eb72..081c9b0 100644 --- a/src/hyper.h +++ b/src/hyper.h @@ -43,7 +43,7 @@ struct hyper_pod { struct list_head exec_head; //struct list_head ce_head; char *hostname; - char *tag; + char *share_tag; int init_pid; uint32_t c_num; uint32_t i_num; diff --git a/src/init.c b/src/init.c index 58c2ecb..b75a88f 100644 --- a/src/init.c +++ b/src/init.c @@ -555,7 +555,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) { struct vbsf_mount_info_new mntinf; - if (pod->tag == NULL) { + if (pod->share_tag == NULL) { fprintf(stdout, "no shared directroy\n"); return 0; } @@ -573,7 +573,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) mntinf.length = sizeof(mntinf); mntinf.dmode = ~0U; mntinf.fmode = ~0U; - strcpy(mntinf.name, pod->tag); + strcpy(mntinf.name, pod->share_tag); if (mount(NULL, "/tmp/hyper/shared", "vboxsf", MS_NODEV, &mntinf) < 0) { @@ -586,7 +586,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) #else static int hyper_setup_shared(struct hyper_pod *pod) { - if (pod->tag == NULL) { + if (pod->share_tag == NULL) { fprintf(stdout, "no shared directroy\n"); return 0; } @@ -596,7 +596,7 @@ static int hyper_setup_shared(struct hyper_pod *pod) return -1; } - if (mount(pod->tag, "/tmp/hyper/shared", "9p", + if (mount(pod->share_tag, "/tmp/hyper/shared", "9p", MS_MGC_VAL| MS_NODEV, "trans=virtio,cache=loose") < 0) { perror("fail to mount shared dir"); @@ -917,16 +917,16 @@ static void hyper_cleanup_hostname(struct hyper_pod *pod) static void hyper_cleanup_shared(struct hyper_pod *pod) { - if (pod->tag == NULL) { + if (pod->share_tag == NULL) { fprintf(stdout, "no shared directroy\n"); return; } - free(pod->tag); - pod->tag = NULL; + free(pod->share_tag); + pod->share_tag = NULL; if (umount("/tmp/hyper/shared") < 0 && umount2("/tmp/hyper/shared", MNT_DETACH)) { - perror("fail to umount 9p dir"); + perror("fail to umount shared dir"); return; } diff --git a/src/parse.c b/src/parse.c index dfb11e3..104493d 100644 --- a/src/parse.c +++ b/src/parse.c @@ -510,8 +510,8 @@ realloc: i += next; } else if (json_token_streq(json, t, "shareDir") && t->size == 1) { - pod->tag = strdup(json_token_str(json, &toks[++i])); - fprintf(stdout, "9p tag is %s\n", pod->tag); + pod->share_tag = strdup(json_token_str(json, &toks[++i])); + fprintf(stdout, "share tag is %s\n", pod->share_tag); } else if (json_token_streq(json, t, "hostname") && t->size == 1) { pod->hostname = strdup(json_token_str(json, &toks[++i])); fprintf(stdout, "hostname is %s\n", pod->hostname);