Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

Commit

Permalink
state: Add the host_path and mnt_dir field to state.
Browse files Browse the repository at this point in the history
These need to be passed to hyperstart with the newcontainer
command for mounting to the correct location within the vm.

Signed-off-by: Archana Shinde <[email protected]>
  • Loading branch information
amshinde committed Jun 18, 2017
1 parent 93b13a3 commit 56bc092
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,14 @@ cc_mounts_to_json (GSList *mounts)
m->directory_created);
}

json_object_set_string_member (mount, "mnt_dir",
m->mnt.mnt_dir);

if (m->host_path) {
json_object_set_string_member (mount, "host_path",
m->host_path);
}

json_array_add_object_element (array, mount);
}

Expand Down
13 changes: 13 additions & 0 deletions src/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,19 @@ handle_state_mounts_section(GNode* node, struct handler_data* data) {
m = (struct cc_oci_mount*)l->data;
m->directory_created = g_strdup((char*)node->children->data);
}
} else if (! g_strcmp0(node->data, "mnt_dir")) {
GSList *l = g_slist_last(data->state->mounts);
if (l) {
m = (struct cc_oci_mount*)l->data;
m->mnt.mnt_dir = g_strdup((char*)node->children->data);

}
} else if (! g_strcmp0(node->data, "host_path")) {
GSList *l = g_slist_last(data->state->mounts);
if (l) {
m = (struct cc_oci_mount*)l->data;
m->host_path = g_strdup((char*)node->children->data);
}
}
}

Expand Down

0 comments on commit 56bc092

Please sign in to comment.