kvm->kvm_run->io.count);
if (!ret)
- goto exit_kvm;
+ goto panic_kvm;
break;
}
case KVM_EXIT_MMIO: {
kvm->kvm_run->mmio.is_write);
if (!ret)
- goto exit_kvm;
+ goto panic_kvm;
break;
}
case KVM_EXIT_INTR: {
serial8250__interrupt(kvm);
break;
}
- default:
+ case KVM_EXIT_SHUTDOWN:
goto exit_kvm;
+ default:
+ goto panic_kvm;
}
}
-
exit_kvm:
+ kvm__delete(kvm);
+ return 0;
+
+panic_kvm:
fprintf(stderr, "KVM exit reason: %" PRIu32 " (\"%s\")\n",
kvm->kvm_run->exit_reason, kvm_exit_reasons[kvm->kvm_run->exit_reason]);
if (kvm->kvm_run->exit_reason == KVM_EXIT_UNKNOWN)
fprintf(stderr, "KVM exit code: 0x%" PRIu64 "\n",
kvm->kvm_run->hw.hardware_exit_reason);
-
kvm__show_registers(kvm);
kvm__show_code(kvm);
kvm__show_page_tables(kvm);
kvm__delete(kvm);
- return 0;
+ return 1;
}