Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge r257996,r258001,r258069 from head: fixes for HyperV guest.

- Set description string for VM_GUEST_HV (HyperV guest).
- Add a brief comment about VM_GUEST and vm_guest_sysctl_names relationship.
- CTASSERT that vm_guest range is covered by vm_guest_sysctl_names.

Approved by:	re (glebius)
  • Loading branch information...
commit a5c87067b831c2e5c0e1889f1d2e562877f6aeff 1 parent 0daddca
pluknet authored
Showing with 5 additions and 1 deletion.
  1. +2 −0  sys/kern/subr_param.c
  2. +3 −1 sys/sys/systm.h
View
2  sys/kern/subr_param.c
@@ -153,8 +153,10 @@ static const char *const vm_guest_sysctl_names[] = {
"none",
"generic",
"xen",
+ "hv",
NULL
};
+CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST);
#ifndef XEN
static const char *const vm_bnames[] = {
View
4 sys/sys/systm.h
@@ -70,8 +70,10 @@ extern int vm_guest; /* Running as virtual machine guest? */
* Detected virtual machine guest types. The intention is to expand
* and/or add to the VM_GUEST_VM type if specific VM functionality is
* ever implemented (e.g. vendor-specific paravirtualization features).
+ * Keep in sync with vm_guest_sysctl_names[].
*/
-enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV };
+enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV,
+ VM_LAST };
#if defined(WITNESS) || defined(INVARIANTS)
void kassert_panic(const char *fmt, ...) __printflike(1, 2);
Please sign in to comment.
Something went wrong with that request. Please try again.