vmd(8): don't remove known vm's from the config on error.
authordv <dv@openbsd.org>
Sun, 22 Jan 2023 22:18:40 +0000 (22:18 +0000)
committerdv <dv@openbsd.org>
Sun, 22 Jan 2023 22:18:40 +0000 (22:18 +0000)
commit10ccde237d44ef8c9af028ae3791c37ec4889acc
tree0570174cb88dccc7227351e10dd1b8be2020d55c
parent700233a6d5ce758bd206e4f896bde19262e2ae56
vmd(8): don't remove known vm's from the config on error.

Multiple error paths, specifically the one related to if a guest
cannot allocate memory at start, resulted in a known vm (via
vm.conf(5)) being removed from the vm list. Adjust the error paths
to check if the failing vm is defined in the config before tearing
it down.

Tested with help from beck@ and Mischa Peters.

ok beck@
usr.sbin/vmd/vmd.c