Do not expose vmm(4) VM IDs to the user, use vmd(8)'s IDs instead.
authorreyk <reyk@openbsd.org>
Thu, 6 Apr 2017 18:07:13 +0000 (18:07 +0000)
committerreyk <reyk@openbsd.org>
Thu, 6 Apr 2017 18:07:13 +0000 (18:07 +0000)
commiteb1cd41d55d3b3be2be9d6542531f075dfd8fa52
treef3803788a90fd3f84c82a61e7c7bb1ad4772e1e4
parent0ca38a4a1fe27029abd76cdf4f6b2de30f4854a5
Do not expose vmm(4) VM IDs to the user, use vmd(8)'s IDs instead.

Each VM has two IDs: one from the kernel (vmm) and a different one
from userland (vmd).  The vmm ID is not consistent and incremented on
every boot during runtimg of the host system.  The vmd ID remains the
same during the lifetime of a configured VM, even after reboots.
Configured VMs will even get and keep their IDs when the configuration
is loaded.  This is more what users expect.

Pointed out and tested by otto@

OK deraadt@
usr.sbin/vmctl/main.c
usr.sbin/vmctl/vmctl.c
usr.sbin/vmctl/vmctl.h
usr.sbin/vmd/vmd.c
usr.sbin/vmd/vmd.h
usr.sbin/vmd/vmm.c