Extend bhyvectl(8) to support querying VM pid using the
`--get-vm-pid` flag.
This is useful in the monitor mode when the VM pid differs
This is useful in monitor mode when the VM pid differs
from the main bhyve(8) process run by the user. Knowing the VM pid
is necessary, for example, to query process resource usage or
trigger ACPI shutdown with SIGTERM.
Of course, it could be obtained by matching the monitor process
children by the process title, but it's a little more complex
and fragile than it could be.
Implement that by introducing the VM_GET_PID ioctl to vmm(8),
exposing tha
Implement through libvmmapi, and using it to implementat by adding the "get_vm_pid" IPC command,
`bhyvectl --get-vm-pid`.
When the VM pid is not knownand using it to implement `bhyvectl --get-vm-pid`, ESRCH is returned.
This information is now also included in the `bhyvectl --get-all`which
output. The `--get-vm-pid` fails when vm_get_pid() returns ESRCH,prints the VM PID.
and `--get-all` just skips it in this case
When the VM PID is not known, ESRCH is returned.