Skip to content

Commit 094a207

Browse files
authored
feat(runtime_engine): pass container_id to create (#171)
Some runtime engines will need the id of the container, so we pass here. Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
1 parent 0e72884 commit 094a207

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/ocre/container.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ struct ocre_container *ocre_container_create(const char *img_path, const char *w
267267
}
268268

269269
container->runtime_context =
270-
container->runtime->create(img_path, workdir, capabilities, (const char **)container->argv,
271-
(const char **)container->envp, mounts);
270+
container->runtime->create(container_id, img_path, workdir, capabilities,
271+
(const char **)container->argv, (const char **)container->envp, mounts);
272272
if (!container->runtime_context) {
273273
LOG_ERR("Failed to create container");
274274
goto error_cond;

src/ocre/container.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* SPDX-License-Identifier: Apache-2.0
66
*/
77

8+
#include <stdbool.h>
9+
810
#include <ocre/ocre.h>
911

1012
struct ocre_container;

src/runtime/include/ocre/runtime/vtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ struct ocre_runtime_vtable {
7575
*
7676
* @return Pointer to the runtime context on success, NULL on failure
7777
*/
78-
void *(*create)(const char *img_path, const char *workdir, const char **capabilities, const char **argv,
79-
const char **envp, const char **mounts);
78+
void *(*create)(const char *container_id, const char *img_path, const char *workdir, const char **capabilities,
79+
const char **argv, const char **envp, const char **mounts);
8080

8181
/**
8282
* @brief Destroy a runtime instance

src/runtime/wamr-wasip1/wamr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ static int runtime_deinit(void)
217217
return 0;
218218
}
219219

220-
static void *instance_create(const char *img_path, const char *workdir, const char **capabilities, const char **argv,
221-
const char **envp, const char **mounts)
220+
static void *instance_create(const char *container_id, const char *img_path, const char *workdir,
221+
const char **capabilities, const char **argv, const char **envp, const char **mounts)
222222
{
223223
struct wamr_context *context = NULL;
224224
// char **dir_map_list = NULL;

0 commit comments

Comments
 (0)