Module Name:    src
Committed By:   maxv
Date:           Mon Apr 29 17:27:57 UTC 2019

Modified Files:
        src/lib/libnvmm: libnvmm.c

Log Message:
Remove useless calls to nvmm_init().


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/lib/libnvmm/libnvmm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libnvmm/libnvmm.c
diff -u src/lib/libnvmm/libnvmm.c:1.10 src/lib/libnvmm/libnvmm.c:1.11
--- src/lib/libnvmm/libnvmm.c:1.10	Sun Apr 28 14:22:13 2019
+++ src/lib/libnvmm/libnvmm.c	Mon Apr 29 17:27:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: libnvmm.c,v 1.10 2019/04/28 14:22:13 maxv Exp $	*/
+/*	$NetBSD: libnvmm.c,v 1.11 2019/04/29 17:27:57 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -237,10 +237,6 @@ nvmm_machine_destroy(struct nvmm_machine
 	struct nvmm_ioc_machine_destroy args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 
 	ret = ioctl(nvmm_fd, NVMM_IOC_MACHINE_DESTROY, &args);
@@ -259,10 +255,6 @@ nvmm_machine_configure(struct nvmm_machi
 	struct nvmm_ioc_machine_configure args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.op = op;
 	args.conf = conf;
@@ -281,10 +273,6 @@ nvmm_vcpu_create(struct nvmm_machine *ma
 	struct nvmm_comm_page *comm;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.cpuid = cpuid;
 
@@ -309,10 +297,6 @@ nvmm_vcpu_destroy(struct nvmm_machine *m
 	struct nvmm_comm_page *comm;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.cpuid = cpuid;
 
@@ -332,10 +316,6 @@ nvmm_vcpu_setstate(struct nvmm_machine *
 {
 	struct nvmm_comm_page *comm;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	if (__predict_false(cpuid >= mach->npages)) {
 		return -1;
 	}
@@ -356,10 +336,6 @@ nvmm_vcpu_getstate(struct nvmm_machine *
 	struct nvmm_comm_page *comm;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	if (__predict_false(cpuid >= mach->npages)) {
 		return -1;
 	}
@@ -389,10 +365,6 @@ nvmm_vcpu_inject(struct nvmm_machine *ma
 	struct nvmm_ioc_vcpu_inject args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.cpuid = cpuid;
 	memcpy(&args.event, event, sizeof(args.event));
@@ -411,10 +383,6 @@ nvmm_vcpu_run(struct nvmm_machine *mach,
 	struct nvmm_ioc_vcpu_run args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.cpuid = cpuid;
 	memset(&args.exit, 0, sizeof(args.exit));
@@ -435,10 +403,6 @@ nvmm_gpa_map(struct nvmm_machine *mach, 
 	struct nvmm_ioc_gpa_map args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	ret = __area_add(mach, hva, gpa, size, prot);
 	if (ret == -1)
 		return -1;
@@ -465,10 +429,6 @@ nvmm_gpa_unmap(struct nvmm_machine *mach
 	struct nvmm_ioc_gpa_unmap args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	ret = __area_delete(mach, hva, gpa, size);
 	if (ret == -1)
 		return -1;
@@ -492,10 +452,6 @@ nvmm_hva_map(struct nvmm_machine *mach, 
 	struct nvmm_ioc_hva_map args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.hva = hva;
 	args.size = size;
@@ -513,10 +469,6 @@ nvmm_hva_unmap(struct nvmm_machine *mach
 	struct nvmm_ioc_hva_unmap args;
 	int ret;
 
-	if (nvmm_init() == -1) {
-		return -1;
-	}
-
 	args.machid = mach->machid;
 	args.hva = hva;
 	args.size = size;

Reply via email to