This patch adds a descriptive string for mapping to the VM_CAP_BPT_EXIT.
I noticed this when using bhyvectl to identify the vmm capabilities.
Details
Details
- Reviewers
araujo jhb rgrimes - Group Reviewers
bhyve - Commits
- rS360166: Add description string for VM_CAP_BPT_EXIT.
without patch:
$ bhyvectl --vm vm --getcap Capability "hlt_exit" is set on vcpu 0 Capability "mtrap_exit" is not available Capability "pause_exit" is set on vcpu 0 Capability "unrestricted_guest" is set on vcpu 0 Capability "enable_invpcid" is not available Capability "(null)" is not available
with patch:
$ bhyvectl --vm vm --getcap Capability "hlt_exit" is set on vcpu 0 Capability "mtrap_exit" is not available Capability "pause_exit" is set on vcpu 0 Capability "unrestricted_guest" is set on vcpu 0 Capability "enable_invpcid" is not available Capability "bpt_exit" is not available
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
BTW, I would suggest replacing this structure with one indexed by the enum values and using nitems() and C99 initializers as a followup change, e.g.:
static const char *capstrmap[] = { [VM_CAP_HALT_EXIT] = "hlt_exit", ... }; const char * vm_capability_type2name(int type) { if (type < nitems(capstrmap)) return (capstrmap[type]); else return (NULL); }
vm_capability_name2type would still have to do a loop, but would use`'i < nitems(capstrmap)` as the terminating condition for the loop.
Comment Actions
Updating D24289: map capability string for VM_CAP_BPT_EXIT
John, per your suggestion.
capstrmap is now indexed by enum vm_cap_type.