# Pastebin 1izthvND diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index be9cd1611700..105d871d0b4e 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -429,6 +429,7 @@ fbsdrun_deletecpu(int vcpu) pthread_mutex_lock(&resetcpu_mtx); if (!CPU_ISSET(vcpu, &cpumask)) { EPRINTLN("Attempting to delete unknown cpu %d", vcpu); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } @@ -478,6 +479,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu) if (exitcode >= VM_EXITCODE_MAX || vmexit_handlers[exitcode] == NULL) { warnx("vm_loop: unexpected exitcode 0x%x", exitcode); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } @@ -489,6 +491,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu) case VMEXIT_ABORT: abort(); default: + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } } @@ -697,6 +700,7 @@ main(int argc, char *argv[]) if (guest_ncpus > max_vcpus) { fprintf(stderr, "%d vCPUs requested but only %d available\n", guest_ncpus, max_vcpus); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } @@ -722,22 +726,27 @@ main(int argc, char *argv[]) error = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); if (error) { fprintf(stderr, "Unable to setup memory (%d)\n", errno); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } init_mem(guest_ncpus); init_bootrom(ctx); - if (bhyve_init_platform(ctx, bsp) != 0) + if (bhyve_init_platform(ctx, bsp) != 0) { + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); + } if (qemu_fwcfg_init(ctx) != 0) { fprintf(stderr, "qemu fwcfg initialization error\n"); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } if (qemu_fwcfg_add_file("opt/bhyve/hw.ncpu", sizeof(guest_ncpus), &guest_ncpus) != 0) { fprintf(stderr, "Could not add qemu fwcfg opt/bhyve/hw.ncpu\n"); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } @@ -747,10 +756,12 @@ main(int argc, char *argv[]) if (init_pci(ctx) != 0) { EPRINTLN("Device emulation initialization error: %s", strerror(errno)); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } if (init_tpm(ctx) != 0) { EPRINTLN("Failed to init TPM device"); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); } @@ -805,8 +816,10 @@ main(int argc, char *argv[]) } #endif - if (bhyve_init_platform_late(ctx, bsp) != 0) + if (bhyve_init_platform_late(ctx, bsp) != 0) { + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); + } /* * Change the proc title to include the VM name. @@ -848,5 +861,6 @@ main(int argc, char *argv[]) */ mevent_dispatch(); + printf("%s:%d exit(4)\n", __func__, __LINE__); exit(4); }