Created
July 29, 2012 09:43
-
-
Save enukane/3197085 to your computer and use it in GitHub Desktop.
fix panic (sleeping thread) on vmmctl --destroy --vm=* when bhyve is runnning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: sys/amd64/vmm/vmm_dev.c | |
=================================================================== | |
--- sys/amd64/vmm/vmm_dev.c (revision 238860) | |
+++ sys/amd64/vmm/vmm_dev.c (working copy) | |
@@ -378,7 +378,9 @@ | |
* XXX must stop virtual machine instances that may be still | |
* running and cleanup their state. | |
*/ | |
+ mtx_lock(&vmmdev_mtx); | |
SLIST_REMOVE(&head, sc, vmmdev_softc, link); | |
+ mtx_unlock(&vmmdev_mtx); | |
destroy_dev(sc->cdev); | |
vm_destroy(sc->vm); | |
free(sc, M_VMMDEV); | |
@@ -398,12 +400,11 @@ | |
mtx_lock(&vmmdev_mtx); | |
sc = vmmdev_lookup(buf); | |
+ mtx_unlock(&vmmdev_mtx); | |
if (sc == NULL) { | |
- mtx_unlock(&vmmdev_mtx); | |
return (EINVAL); | |
} | |
vmmdev_destroy(sc); | |
- mtx_unlock(&vmmdev_mtx); | |
return (0); | |
} | |
SYSCTL_PROC(_hw_vmm, OID_AUTO, destroy, CTLTYPE_STRING | CTLFLAG_RW, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment