diff options
author | grehan <grehan@FreeBSD.org> | 2013-08-01 05:59:28 +0000 |
---|---|---|
committer | grehan <grehan@FreeBSD.org> | 2013-08-01 05:59:28 +0000 |
commit | 41f621778a950e5cb55321f73b6aa5a79df7c4a1 (patch) | |
tree | 9385867f09cde61d5b4218cdd862b6b0b1666ec9 /sys/amd64 | |
parent | 29177b0ce822d54a4139f17afb242ada19710aa8 (diff) | |
download | FreeBSD-src-41f621778a950e5cb55321f73b6aa5a79df7c4a1.zip FreeBSD-src-41f621778a950e5cb55321f73b6aa5a79df7c4a1.tar.gz |
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 <at> plurisbusnetworks.com)
Reviewed by: grehan, neel
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/vmm/vmm.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index 67e9e60..b4f3c33 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; |