Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86: support mapdir on wasi #98

Merged
merged 1 commit into from
Aug 3, 2023
Merged

x86: support mapdir on wasi #98

merged 1 commit into from
Aug 3, 2023

Conversation

ktock
Copy link
Owner

@ktock ktock commented Aug 3, 2023

This commit adds support for --mapdir for x86_64(bochs)-based containers.
This is done by porting TinyEMU's virtio-9p implementation to bochs.
Now wasi runtimes shares files to bochs via WASI(--mapdir) and bochs shares these files to the guest Linux VM via virtio-9p.

$ make
$ ./out/c2w --assets=. alpine:3.17 /tmp/out/out.wasm
$ mkdir -p /tmp/share/ && echo hi > /tmp/share/from-host
$ wasmtime --mapdir /mnt/share::/tmp/share /tmp/out/out.wasm cat /mnt/share/from-host
hi

@ktock ktock force-pushed the mapdir branch 3 times, most recently from d3c291f to 1f9bb9d Compare August 3, 2023 04:55
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
@ktock ktock merged commit 393f772 into main Aug 3, 2023
8 checks passed
@ktock ktock deleted the mapdir branch August 3, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant