4 ms·
Hey, great idea. I'm still a bit of a Rust newb but I'm interested in helping if you have a starting point. Otherwise, I'll start looking into it myself.
by wyldfire 11y ago
Hey, great idea. I'm still a bit of a Rust newb but I'm interested in helping if you have a starting point. Otherwise, I'll start looking into it myself.
- JoshTriplett 11y agoThe /dev/kvm API has a hard dependency on union support, and rustc hasn't yet implemented RFC1444, so I hadn't planned to attempt to create a KVM crate until that point. Once that happens, I'll start building prototypes and pushing them to github and Cargo. In the meantime, here's an article I wrote on the /dev/kvm API, including how to drive it directly from a small C program: https://lwn.net/Articles/658511/ https://lwn.net/Articles/658511/ (edit: fixed URL)
- wyldfire 11y agoI think you meant to link to https://lwn.net/Articles/658511/ https://lwn.net/Articles/658511/ Why can't we just alias the storage to something different underneath? How is there a "hard" requirement? Unless it's difficult/impossible to make the representation align correctly without the same semantics?
- JoshTriplett 11y agoThe main data structure for /dev/kvm is `struct kvm_run`, which includes a massive union. There are also unions spread out across the rest of the API; half the structures in the API have some kind of union in them. It would be possible to make that work using unsafe operations like `std::mem::transmute` and careful manual pointer offsets, but that would eliminate much of the benefit of doing this in Rust in the first place.