bhyve: fix domain management

When domain is not persistent, it should be forgotten upon destroying.
This commit is contained in:
Wojciech Macek authored and Roman Bogorodskiy committed 2014-04-11 20:18:44 +04:00
1 parent 86cfa1f603
commit 1ee866cf33
1 file changed
+7 -1
+7 -1
View File
@@ -753,8 +753,14 @@ bhyveDomainDestroy(virDomainPtr dom)
ret = virBhyveProcessStop(privconn, vm, VIR_DOMAIN_SHUTOFF_DESTROYED);
if (!vm->persistent) {
virDomainObjListRemove(privconn->domains, vm);
vm = NULL;
}
cleanup:
virObjectUnlock(vm);
if (vm)
virObjectUnlock(vm);
return ret;
}