summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-12-01 10:12:16 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-12-01 10:12:16 +0000
commit34e3169d5332c14f123c613987c57c05676d4023 (patch)
treea14c4ee1eef61648b869797d769ede23e70e59e9
parentdee3ac8d39a8330669e3f5442bd217cebfb27d9a (diff)
Prettify dmesg output.
ok reyk@, mlarkin@
-rw-r--r--sys/arch/amd64/amd64/vmm.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index 0f45ba18a2e..ac25b8df39f 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.10 2015/12/01 10:08:10 mpi Exp $ */
+/* $OpenBSD: vmm.c,v 1.11 2015/12/01 10:12:15 mpi Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -213,11 +213,10 @@ vmm_probe(struct device *parent, void *match, void *aux)
void
vmm_attach(struct device *parent, struct device *self, void *aux)
{
- struct vmm_softc *sc;
+ struct vmm_softc *sc = (struct vmm_softc *)self;
struct cpu_info *ci;
CPU_INFO_ITERATOR cii;
- sc = (struct vmm_softc *)self;
sc->nr_vmx_cpus = 0;
sc->nr_svm_cpus = 0;
sc->nr_rvi_cpus = 0;
@@ -240,14 +239,14 @@ vmm_attach(struct device *parent, struct device *self, void *aux)
SLIST_INIT(&sc->vm_list);
rw_init(&sc->vm_lock, "vmlistlock");
- printf(": initialized\n");
-
if (sc->nr_vmx_cpus)
- printf("%s: %u VMX capable CPU(s), %u are EPT capable\n",
- DEVNAME(sc), sc->nr_vmx_cpus, sc->nr_ept_cpus);
- if (sc->nr_svm_cpus)
- printf("%s: %u SVM capable CPU(s), %u are RVI capable\n",
- DEVNAME(sc), sc->nr_svm_cpus, sc->nr_rvi_cpus);
+ printf(": %u VMX capable CPU%s, %u %s EPT capable\n",
+ sc->nr_vmx_cpus, (sc->nr_vmx_cpus > 1) ? "s" : "",
+ sc->nr_ept_cpus, (sc->nr_ept_cpus > 1) ? "are" : "is");
+ else if (sc->nr_svm_cpus)
+ printf(": %u SVM capable CPU%s, %u %s RVI capable\n",
+ sc->nr_svm_cpus, (sc->nr_svm_cpus > 1) ? "s" : "",
+ sc->nr_rvi_cpus, (sc->nr_rvi_cpus > 1) ? "are" : "is");
pool_init(&vm_pool, sizeof(struct vm), 0, 0, PR_WAITOK, "vmpool",
NULL);