consolidate vm-related headers for bhyve
When bhyve was ported to illumos, care was taken to maintain compatibility headers in order to minimize source changes from upstream. As work has continued on the in-kernel portions of bhyve, minimization of that delta is no longer a concern, and we've been cleaning things up to bring them closer in line with the expectations of illumos style and organization.
It would be good to do the same with the VM-related headers as those are particularly messy. Doing so will leave us in a better position to implement new features like live migration.
TESTING: I built against HEAD with and without this change and used `wsdiff`; the only changes were either trivial code location moves, but identical code (a lot of code shifted by 16 bytes), and the simplified `if` in `vmm_mmap_memseg`: a "can't happen" scenario was pulled out of the code: the symbol `KERN_RESOURCE_SHORTAGE` was `#define`'d to `ENOMEM`; however, that symbol was never used anywhere other than the conditional in `vmm_mmap_memseg`, which compared it to the `error` value returned `vm_map_wire` in the non-zero case. However, inspection of `vm_map_wire` shows that it can only ever return 0 (success) or `FC_NOMAP`, which is a fault code for when a mapping doesn't exist: it never returns `ENOMEM`, let alone `KERN_RESOURCE_SHORTAGE` (which has been entirely removed, anyway). Thus, in the failure case in this code stanza, we should only ever return `EFAULT`; the condition for `ENOMEM` was superfluous.
The only other differences were hardcoded strings: either the `git` commit ID, or date/time in `motd`.
Updated by Electric Monk 8 months ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit cf409e3f26ef8db450f46ba9760eb9734f603ae0 Author: Dan Cross <firstname.lastname@example.org> Date: 2021-06-01T02:20:34.000Z 13825 consolidate vm-related headers for bhyve Reviewed by: Patrick Mooney <email@example.com> Reviewed by: Yuri Pankov <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>