rename pod->tag to pod->share_tag

Signed-off-by: Lai Jiangshan <jiangshanlai@gmail.com>
This commit is contained in:
Lai Jiangshan
2015-10-08 17:00:09 +08:00
parent 910a42d647
commit 7075847ef4
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -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;
+8 -8
View File
@@ -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;
}
+2 -2
View File
@@ -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);