{"body":"diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c\nindex be9cd1611700..105d871d0b4e 100644\n--- a/usr.sbin/bhyve/bhyverun.c\n+++ b/usr.sbin/bhyve/bhyverun.c\n@@ -429,6 +429,7 @@ fbsdrun_deletecpu(int vcpu)\n \tpthread_mutex_lock(&resetcpu_mtx);\n \tif (!CPU_ISSET(vcpu, &cpumask)) {\n \t\tEPRINTLN(\"Attempting to delete unknown cpu %d\", vcpu);\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \n@@ -478,6 +479,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu)\n \t\tif (exitcode >= VM_EXITCODE_MAX ||\n \t\t    vmexit_handlers[exitcode] == NULL) {\n \t\t\twarnx(\"vm_loop: unexpected exitcode 0x%x\", exitcode);\n+\t\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\t\texit(4);\n \t\t}\n \n@@ -489,6 +491,7 @@ vm_loop(struct vmctx *ctx, struct vcpu *vcpu)\n \t\tcase VMEXIT_ABORT:\n \t\t\tabort();\n \t\tdefault:\n+\t\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\t\texit(4);\n \t\t}\n \t}\n@@ -697,6 +700,7 @@ main(int argc, char *argv[])\n \tif (guest_ncpus > max_vcpus) {\n \t\tfprintf(stderr, \"%d vCPUs requested but only %d available\\n\",\n \t\t\tguest_ncpus, max_vcpus);\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \n@@ -722,22 +726,27 @@ main(int argc, char *argv[])\n \terror = vm_setup_memory(ctx, memsize, VM_MMAP_ALL);\n \tif (error) {\n \t\tfprintf(stderr, \"Unable to setup memory (%d)\\n\", errno);\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \n \tinit_mem(guest_ncpus);\n \tinit_bootrom(ctx);\n-\tif (bhyve_init_platform(ctx, bsp) != 0)\n+\tif (bhyve_init_platform(ctx, bsp) != 0) {\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n+\t}\n \n \tif (qemu_fwcfg_init(ctx) != 0) {\n \t\tfprintf(stderr, \"qemu fwcfg initialization error\\n\");\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \n \tif (qemu_fwcfg_add_file(\"opt/bhyve/hw.ncpu\", sizeof(guest_ncpus),\n \t    &guest_ncpus) != 0) {\n \t\tfprintf(stderr, \"Could not add qemu fwcfg opt/bhyve/hw.ncpu\\n\");\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \n@@ -747,10 +756,12 @@ main(int argc, char *argv[])\n \tif (init_pci(ctx) != 0) {\n \t\tEPRINTLN(\"Device emulation initialization error: %s\",\n \t\t    strerror(errno));\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \tif (init_tpm(ctx) != 0) {\n \t\tEPRINTLN(\"Failed to init TPM device\");\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n \t}\n \n@@ -805,8 +816,10 @@ main(int argc, char *argv[])\n \t}\n #endif\n \n-\tif (bhyve_init_platform_late(ctx, bsp) != 0)\n+\tif (bhyve_init_platform_late(ctx, bsp) != 0) {\n+\t\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \t\texit(4);\n+\t}\n \n \t/*\n \t * Change the proc title to include the VM name.\n@@ -848,5 +861,6 @@ main(int argc, char *argv[])\n \t */\n \tmevent_dispatch();\n \n+\tprintf(\"%s:%d exit(4)\\n\", __func__, __LINE__);\n \texit(4);\n }\n\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/1izthvND","modified":1751459383,"id":"1izthvND","size":2756,"lines":98,"own_paste":false,"theme":"","date":1751459383}