Date: Wed, 31 Dec 2014 06:54:29 +0000 (UTC) From: Bryan Venteicher <bryanv@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r276453 - in projects/paravirt/sys/x86: include x86 Message-ID: <201412310654.sBV6sTlj060464@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bryanv Date: Wed Dec 31 06:54:28 2014 New Revision: 276453 URL: https://svnweb.freebsd.org/changeset/base/276453 Log: Various cleanup Modified: projects/paravirt/sys/x86/include/hypervisor.h projects/paravirt/sys/x86/x86/hypervisor.c Modified: projects/paravirt/sys/x86/include/hypervisor.h ============================================================================== --- projects/paravirt/sys/x86/include/hypervisor.h Wed Dec 31 06:53:46 2014 (r276452) +++ projects/paravirt/sys/x86/include/hypervisor.h Wed Dec 31 06:54:28 2014 (r276453) @@ -44,4 +44,3 @@ int hypervisor_cpuid_base(const char *si void hypervisor_print_info(void); #endif /* !_X86_HYPERVISOR_H_ */ - Modified: projects/paravirt/sys/x86/x86/hypervisor.c ============================================================================== --- projects/paravirt/sys/x86/x86/hypervisor.c Wed Dec 31 06:53:46 2014 (r276452) +++ projects/paravirt/sys/x86/x86/hypervisor.c Wed Dec 31 06:54:28 2014 (r276453) @@ -28,8 +28,6 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> -#include <sys/limits.h> -#include <sys/kernel.h> #include <sys/sysctl.h> #include <sys/systm.h> @@ -37,8 +35,6 @@ __FBSDID("$FreeBSD$"); #include <machine/cpu.h> #include <x86/hypervisor.h> -#include <x86/kvm.h> -#include <x86/vmware.h> char hv_vendor[16]; SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, @@ -88,13 +84,15 @@ hypervisor_cpuid_identify(void) if (hvi->hvi_identify() != 0) { hv_info = hvi; - vm_guest = hvi->hvi_type; - strncpy(hv_vendor, hvi->hvi_name, sizeof(hv_vendor)); - return; + break; } } - vm_guest = VM_GUEST_VM; + if (hv_info != NULL) { + vm_guest = hvi->hvi_type; + strlcpy(hv_vendor, hvi->hvi_name, sizeof(hv_vendor)); + } else + vm_guest = VM_GUEST_VM; } void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412310654.sBV6sTlj060464>