From 81ef6611ed72b3c10e079052da5d79c9a25f7449 Mon Sep 17 00:00:00 2001 From: Peter Grehan Date: Thu, 1 Aug 2013 05:59:28 +0000 Subject: [PATCH] Moved clearing of vmm_initialized to avoid the case of unloading the module while VMs existed. This would result in EBUSY, but would prevent further operations on VMs resulting in the module being impossible to unload. Submitted by: Tycho Nightingale (tycho.nightingale plurisbusnetworks.com) Reviewed by: grehan, neel --- sys/amd64/vmm/vmm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 67e9e60402e..b4f3c33367a 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -224,8 +224,13 @@ vmm_handler(module_t mod, int what, void *arg) iommu_cleanup(); vmm_ipi_cleanup(); error = VMM_CLEANUP(); + /* + * Something bad happened - prevent new + * VMs from being created + */ + if (error) + vmm_initialized = 0; } - vmm_initialized = 0; break; default: error = 0;