PC-BSD/trueos a7cf097usr.sbin/bhyve bhyverun.c mevent_test.c

- Improve bhyve exit(3) error code.

The bhyve(8) exit status indicates how the VM was terminated:
        0       rebooted
        1       powered off
        2       halted
        3       triple fault

The problem is when we have wrappers around bhyve that parses the exit error code and gets an exit(1) for an error but inteprets it as "powered off".
So to mitigate this issue and makes it less error prone for third part applications, I have replaced exit(3) with value 1 to err(3) with a proper exit error from sysexits(3).

TEST PLAN
As an example without patch:

1) "Could not open backing file":
root at mp03:/ # bhyve -A -H -P -c 3 -m 8098M -s 0:0,hostbridge -s 31,lpc -l com1,/dev/nmdm1A -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 29,fbuf,tcp=10.20.21.2:6032,w=800,h=600 -s 30,xhci,tablet -s 4,virtio-blk,/dev/la/la -s 5,virtio-net,tap10,mac=00:a0:98:2c:d5:9f FreeBSD
bhyve: Could not open backing file: /dev/la/la: No such file or directory
Could not open backing file: No such file or directory
root at mp03:/ # echo $?
1

2) "Invalid PCI slot number":
root at mp03:/ # bhyve -A -H -P -c 3 -m 8098M -s 0:0,hostbridge -s 31,lpc -l com1,/dev/nmdm1A -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 29,fbuf,tcp=10.20.21.2:6032,w=800,h=600 -s 30,xhci,tablet -s 4,virtio-blk,/dev/la/la -s 50000000,virtio-net,tap10,mac=00:a0:98:2c:d5:9f FreeBSD
Invalid PCI slot info field "50000000,virtio-net,tap10,mac=00:a0:98:2c:d5:9f"
root at mp03:/ # echo $?
1

Example with this patch:

1) "Could not open backing file":
root at mp03:/ # bhyve -A -H -P -c 3 -m 8098M -s 0:0,hostbridge -s 31,lpc -l com1,/dev/nmdm1A -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 29,fbuf,tcp=10.20.21.2:6032,w=800,h=600 -s 30,xhci,tablet -s 4,virtio-blk,/dev/la/la -s 5,virtio-net,tap10,mac=00:a0:98:2c:d5:9f FreeBSD
bhyve: la Could not open backing file: /dev/la/la: No such file or directory
Could not open backing file: No such file or directory
bhyve: device emulation error in its initialization
root at mp03:/ # echo $?
69

2) "Invalid PCI slot number":
root at mp03:/ # bhyve -A -H -P -c 3 -m 8098M -s 0:0,hostbridge -s 31,lpc -l com1,/dev/nmdm1A -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd -s 29,fbuf,tcp=10.20.21.2:6032,w=800,h=600 -s 30,xhci,tablet -s 4,virtio-blk,/dev/la/la -s 500000000,virtio-net,tap10,mac=00:a0:98:2c:d5:9f FreeBSD
Invalid PCI slot info field "500000000,virtio-net,tap10,mac=00:a0:98:2c:d5:9f"
bhyve: invalid pci slot
root at mp03:/ # echo $?
64

From review: https://reviews.freebsd.org/D16161
DeltaFile
+22-36usr.sbin/bhyve/bhyverun.c
+6-8usr.sbin/bhyve/mevent_test.c
+4-8usr.sbin/bhyve/dbgport.c
+3-2usr.sbin/bhyve/fwctl.c
+1-2usr.sbin/bhyve/pci_e82545.c
+36-565 files

UnifiedSplitRaw