rust-vmm / vm-memory

Virtual machine's guest memory crate
Apache License 2.0
299 stars 97 forks source link

mmap_xen: Don't drop the FileOffset while in use #245

Closed vireshk closed 1 year ago

vireshk commented 1 year ago

The drop implementation of struct MmapXenGrant issues an Ioctl call, which uses the file descriptor.

Currently the FileOffset is getting dropped before that, and results in "Bad File Descriptor" error from the Ioctl. This commit fixes it by keeping a copy of the same in struct MmapXenGrant.