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

virtiofs File::metadata support #1516

Closed
m-mueller678 opened this issue Nov 13, 2024 · 4 comments · Fixed by #1512
Closed

virtiofs File::metadata support #1516

m-mueller678 opened this issue Nov 13, 2024 · 4 comments · Fixed by #1512
Assignees

Comments

@m-mueller678
Copy link
Contributor

Currently, getting the metadata for a handle to a virtiofs file fails with an InvalidInput error:

fn main(){
    let file = File::open("/root/example.csv").unwrap();
    file.metadata().unwrap();
}

This, however, works fine.

fs::metadata("/root/example.csv")

I did not test other filesystems, they may or may not have the same issue

@n0toose
Copy link
Member

n0toose commented Dec 13, 2024

To the best of my knowledge, I discovered yesterday that this issue also affects Uhyve.

@m-mueller678
Copy link
Contributor Author

I started work on this yesterday. It seems straight forward, though I am not super confident about my understanding of virtiofs.

@n0toose
Copy link
Member

n0toose commented Dec 13, 2024

though I am not super confident about my understanding of virtiofs

Is anyone really confident about their understanding of virtio-fs? Been having some troubles myself as of the past two days - mind if I ask you for the precise QEMU command that you used?

I'm facing another issue and I'm currently trying to reproduce it - I'd be interested in reproducing this issue locally as well, and your attempt seems to be fairing way better than mine.

@mkroening mkroening assigned m-mueller678 and unassigned mkroening Dec 13, 2024
@m-mueller678
Copy link
Contributor Author

This is what I am using right now to run my application:

virtiofsd --shared-dir=./test_dir --socket-path=/tmp/vhostqemu &

qemu-system-x86_64\
  -cpu host\
  -enable-kvm\
  -display none\
  -smp 1\
  -m 8G\
  -serial stdio\
  -kernel ~/Downloads/hermit-loader-x86_64\
  -initrd target/x86_64-unknown-hermit/debug/hermit-rs-template\
  -chardev socket,id=char0,path=/tmp/vhostqemu\
  -device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=root\
  -object memory-backend-file,id=mem,size=8G,mem-path=/dev/shm,share=on\
  -numa node,memdev=mem

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 a pull request may close this issue.

3 participants