Page MenuHomeFreeBSD

D16161.id45135.diff
No OneTemporary

D16161.id45135.diff

Index: head/usr.sbin/bhyve/bhyve.8
===================================================================
--- head/usr.sbin/bhyve/bhyve.8
+++ head/usr.sbin/bhyve/bhyve.8
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd Jul 05, 2018
+.Dd Jul 11, 2018
.Dt BHYVE 8
.Os
.Sh NAME
@@ -520,6 +520,8 @@
halted
.It 3
triple fault
+.It 4
+exited due to an error
.El
.Sh EXAMPLES
If not using a boot ROM, the guest operating system must have been loaded with
Index: head/usr.sbin/bhyve/bhyverun.c
===================================================================
--- head/usr.sbin/bhyve/bhyverun.c
+++ head/usr.sbin/bhyve/bhyverun.c
@@ -397,7 +397,7 @@
if (!CPU_ISSET(vcpu, &cpumask)) {
fprintf(stderr, "Attempting to delete unknown cpu %d\n", vcpu);
- exit(1);
+ exit(4);
}
CPU_CLR_ATOMIC(vcpu, &cpumask);
@@ -742,7 +742,7 @@
if (exitcode >= VM_EXITCODE_MAX || handler[exitcode] == NULL) {
fprintf(stderr, "vm_loop: unexpected exitcode 0x%x\n",
exitcode);
- exit(1);
+ exit(4);
}
rc = (*handler[exitcode])(ctx, &vmexit[vcpu], &vcpu);
@@ -753,7 +753,7 @@
case VMEXIT_ABORT:
abort();
default:
- exit(1);
+ exit(4);
}
}
fprintf(stderr, "vm_run error %d, errno %d\n", error, errno);
@@ -785,7 +785,7 @@
err = vm_get_capability(ctx, cpu, VM_CAP_HALT_EXIT, &tmp);
if (err < 0) {
fprintf(stderr, "VM exit on HLT not supported\n");
- exit(1);
+ exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_HALT_EXIT, 1);
if (cpu == BSP)
@@ -800,7 +800,7 @@
if (err < 0) {
fprintf(stderr,
"SMP mux requested, no pause support\n");
- exit(1);
+ exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_PAUSE_EXIT, 1);
if (cpu == BSP)
@@ -814,7 +814,7 @@
if (err) {
fprintf(stderr, "Unable to set x2apic state (%d)\n", err);
- exit(1);
+ exit(4);
}
vm_set_capability(ctx, cpu, VM_CAP_ENABLE_INVPCID, 1);
@@ -850,7 +850,7 @@
}
} else {
perror("vm_create");
- exit(1);
+ exit(4);
}
} else {
if (!romboot) {
@@ -859,14 +859,14 @@
* bootrom must be configured to boot it.
*/
fprintf(stderr, "virtual machine cannot be booted\n");
- exit(1);
+ exit(4);
}
}
ctx = vm_open(vmname);
if (ctx == NULL) {
perror("vm_open");
- exit(1);
+ exit(4);
}
#ifndef WITHOUT_CAPSICUM
@@ -888,7 +888,7 @@
error = vm_reinit(ctx);
if (error) {
perror("vm_reinit");
- exit(1);
+ exit(4);
}
}
error = vm_set_topology(ctx, sockets, cores, threads, maxcpus);
@@ -967,7 +967,7 @@
break;
case 's':
if (pci_parse_slot(optarg) != 0)
- exit(1);
+ exit(4);
else
break;
case 'S':
@@ -1033,7 +1033,7 @@
if (guest_ncpus > max_vcpus) {
fprintf(stderr, "%d vCPUs requested but only %d available\n",
guest_ncpus, max_vcpus);
- exit(1);
+ exit(4);
}
fbsdrun_set_capabilities(ctx, BSP);
@@ -1042,13 +1042,13 @@
err = vm_setup_memory(ctx, memsize, VM_MMAP_ALL);
if (err) {
fprintf(stderr, "Unable to setup memory (%d)\n", errno);
- exit(1);
+ exit(4);
}
error = init_msr();
if (error) {
fprintf(stderr, "init_msr error %d", error);
- exit(1);
+ exit(4);
}
init_mem();
@@ -1063,8 +1063,10 @@
/*
* Exit if a device emulation finds an error in its initilization
*/
- if (init_pci(ctx) != 0)
- exit(1);
+ if (init_pci(ctx) != 0) {
+ perror("device emulation initialization error");
+ exit(4);
+ }
if (dbg_port != 0)
init_dbgport(dbg_port);
@@ -1079,7 +1081,7 @@
if (vm_set_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, 1)) {
fprintf(stderr, "ROM boot failed: unrestricted guest "
"capability not available\n");
- exit(1);
+ exit(4);
}
error = vcpu_reset(ctx, BSP);
assert(error == 0);
@@ -1093,8 +1095,10 @@
*/
if (mptgen) {
error = mptable_build(ctx, guest_ncpus);
- if (error)
- exit(1);
+ if (error) {
+ perror("error to build the guest tables");
+ exit(4);
+ }
}
error = smbios_build(ctx);
@@ -1133,5 +1137,5 @@
*/
mevent_dispatch();
- exit(1);
+ exit(4);
}
Index: head/usr.sbin/bhyve/dbgport.c
===================================================================
--- head/usr.sbin/bhyve/dbgport.c
+++ head/usr.sbin/bhyve/dbgport.c
@@ -139,8 +139,8 @@
conn_fd = -1;
if ((listen_fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- perror("socket");
- exit(1);
+ perror("cannot create socket");
+ exit(4);
}
sin.sin_len = sizeof(sin);
@@ -151,18 +151,18 @@
reuse = 1;
if (setsockopt(listen_fd, SOL_SOCKET, SO_REUSEADDR, &reuse,
sizeof(reuse)) < 0) {
- perror("setsockopt");
- exit(1);
+ perror("cannot set socket options");
+ exit(4);
}
if (bind(listen_fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- perror("bind");
- exit(1);
+ perror("cannot bind socket");
+ exit(4);
}
if (listen(listen_fd, 1) < 0) {
- perror("listen");
- exit(1);
+ perror("cannot listen socket");
+ exit(4);
}
#ifndef WITHOUT_CAPSICUM
Index: head/usr.sbin/bhyve/fwctl.c
===================================================================
--- head/usr.sbin/bhyve/fwctl.c
+++ head/usr.sbin/bhyve/fwctl.c
@@ -375,7 +375,7 @@
/* Verify size */
if (value < 12) {
printf("msg size error");
- exit(1);
+ exit(4);
}
rinfo.req_size = value;
rinfo.req_count = 1;
Index: head/usr.sbin/bhyve/mevent_test.c
===================================================================
--- head/usr.sbin/bhyve/mevent_test.c
+++ head/usr.sbin/bhyve/mevent_test.c
@@ -143,7 +143,7 @@
mev = mevent_add(fd, EVF_READ, echoer_callback, &sync);
if (mev == NULL) {
printf("Could not allocate echoer event\n");
- exit(1);
+ exit(4);
}
while (!pthread_cond_wait(&sync.e_cond, &sync.e_mt)) {
@@ -200,8 +200,8 @@
static int first;
if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
- perror("socket");
- exit(1);
+ perror("cannot create socket");
+ exit(4);
}
sin.sin_len = sizeof(sin);
@@ -210,13 +210,13 @@
sin.sin_port = htons(TEST_PORT);
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- perror("bind");
- exit(1);
+ perror("cannot bind socket");
+ exit(4);
}
if (listen(s, 1) < 0) {
- perror("listen");
- exit(1);
+ perror("cannot listen socket");
+ exit(4);
}
(void) mevent_add(s, EVF_READ, acceptor_callback, NULL);
Index: head/usr.sbin/bhyve/pci_e82545.c
===================================================================
--- head/usr.sbin/bhyve/pci_e82545.c
+++ head/usr.sbin/bhyve/pci_e82545.c
@@ -2224,7 +2224,7 @@
sc->esc_tapfd = open(tbuf, O_RDWR);
if (sc->esc_tapfd == -1) {
DPRINTF("unable to open tap device %s\n", opts);
- exit(1);
+ exit(4);
}
/*

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 26, 1:46 AM (3 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30358542
Default Alt Text
D16161.id45135.diff (6 KB)

Event Timeline