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

convert virtiofs driver to support the new virtqueue implementation #661

Merged
merged 16 commits into from
Mar 3, 2023

Conversation

stlankes
Copy link
Contributor

@stlankes stlankes commented Feb 26, 2023

This PR converts the old virtio-fs driver and tested it with virtiofsd. The old version are written for the old virtio implementation. To test the interface, a local directory is mapped within the guest to /root. The demo application is able to create a file foo.txt and is also able to read the file (see create_file in examples/demo/src/tests/mod.rs ).

Build demo:

$ cargo build -Zbuild-std=std,panic_abort --target x86_64-unknown-hermit -p rusty_demo --release

Run following demo as root:

$ mkdir testdir
$ virtiofsd --socket-path=./vhostqemu --shared-dir ./testdir --announce-submounts --sandbox none --seccomp none --inode-file-handles=never
$ qemu-system-x86_64 -display none -smp 1 -m 1G -serial stdio \
            -cpu qemu64,apic,fsgsbase,rdtscp,xsave,xsaveopt,fxsr \
            -device isa-debug-exit,iobase=0xf4,iosize=0x04 \
            -kernel rusty-loader-x86_64 \
            -chardev socket,id=char0,path=./vhostqemu \
            -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=root \
            -object memory-backend-file,id=mem,size=1G,mem-path=/dev/shm,share=on -numa node,memdev=mem \
            -initrd target/x86_64-unknown-hermit/release/rusty_demo

- Virtqueues are also modified to support unsized objects
- the network driver is also modified to support the changes in the
  changes in the virtqueue implementation
@stlankes stlankes marked this pull request as draft February 26, 2023 13:40
@stlankes stlankes marked this pull request as ready for review February 26, 2023 15:29
Copy link
Member

@mkroening mkroening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 3, 2023

@bors bors bot merged commit dd2ca94 into hermit-os:master Mar 3, 2023
@mkroening mkroening changed the title convert virtio-fs driver to support the new virtqueue implementation convert virtiofs driver to support the new virtqueue implementation Mar 25, 2023
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.

None yet

2 participants