rust-vmm / vm-memory

Virtual machine's guest memory crate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add constructors to mmap_unix

sboeuf opened this issue · comments

It'd be useful to add a global constructor to MmapRegion in mmap_unix.rs (here) since this would provide a proper wrapper for the mmap() syscall.

The point would be to be able to provide PROT_NONE/READ/WRITE along with MAP_SHARED/PRIVATE/..., so that we're not tied to the predefined prototype and map types.

@bonzini @jiangliu @alexandruag wdyt?

We have used the build() constructor to create mmap region for virtio-fs:)
And the libc::MAP_NORESERVE flags may be a special case for virtio-fs.

Oh my bad, I didn't even see the build() constructor...