Skip to content

Commit

Permalink
Add vendor ID for the bhyve hypervisor (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
tklauser authored and klauspost committed Jan 10, 2019
1 parent c640019 commit 0da0211
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Package home: https://github.com/klauspost/cpuid
* **MSVM** (Microsoft Hyper-V or Windows Virtual PC)
* **VMware**
* **XenHVM**
* **Bhyve**

# installing

Expand Down
4 changes: 3 additions & 1 deletion cpuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const (
MSVM // Microsoft Hyper-V or Windows Virtual PC
VMware
XenHVM
Bhyve
)

const (
Expand Down Expand Up @@ -527,7 +528,7 @@ func (c CPUInfo) LogicalCPU() int {
// have many false negatives.
func (c CPUInfo) VM() bool {
switch c.VendorID {
case MSVM, KVM, VMware, XenHVM:
case MSVM, KVM, VMware, XenHVM, Bhyve:
return true
}
return false
Expand Down Expand Up @@ -670,6 +671,7 @@ var vendorMapping = map[string]Vendor{
"Microsoft Hv": MSVM,
"VMwareVMware": VMware,
"XenVMMXenVMM": XenHVM,
"bhyve bhyve ": Bhyve,
}

func vendorID() Vendor {
Expand Down

0 comments on commit 0da0211

Please sign in to comment.