Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/bhyverun.c
Show All 12 Lines | |||||
* Add all vCPUs. | * Add all vCPUs. | ||||
*/ | */ | ||||
for (int vcpuid = 0; vcpuid < guest_ncpus; vcpuid++) | for (int vcpuid = 0; vcpuid < guest_ncpus; vcpuid++) | ||||
spinup_vcpu(&vcpu_info[vcpuid], vcpuid == BSP); | spinup_vcpu(&vcpu_info[vcpuid], vcpuid == BSP); | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
if (restore_file != NULL) { | if (restore_file != NULL) { | ||||
fprintf(stdout, "Pausing pci devs...\r\n"); | fprintf(stdout, "Pausing pci devs...\r\n"); | ||||
if (vm_pause_user_devs() != 0) { | if (vm_pause_devices() != 0) { | ||||
fprintf(stderr, "Failed to pause PCI device state.\n"); | fprintf(stderr, "Failed to pause PCI device state.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
fprintf(stdout, "Restoring vm mem...\r\n"); | fprintf(stdout, "Restoring vm mem...\r\n"); | ||||
if (restore_vm_mem(ctx, &rstate) != 0) { | if (restore_vm_mem(ctx, &rstate) != 0) { | ||||
fprintf(stderr, "Failed to restore VM memory.\n"); | fprintf(stderr, "Failed to restore VM memory.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
fprintf(stdout, "Restoring pci devs...\r\n"); | fprintf(stdout, "Restoring pci devs...\r\n"); | ||||
if (vm_restore_user_devs(&rstate) != 0) { | if (vm_restore_devices(&rstate) != 0) { | ||||
fprintf(stderr, "Failed to restore PCI device state.\n"); | fprintf(stderr, "Failed to restore PCI device state.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
fprintf(stdout, "Restoring kernel structs...\r\n"); | fprintf(stdout, "Restoring kernel structs...\r\n"); | ||||
if (vm_restore_kern_structs(ctx, &rstate) != 0) { | if (vm_restore_kern_structs(ctx, &rstate) != 0) { | ||||
fprintf(stderr, "Failed to restore kernel structs.\n"); | fprintf(stderr, "Failed to restore kernel structs.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
fprintf(stdout, "Resuming pci devs...\r\n"); | fprintf(stdout, "Resuming pci devs...\r\n"); | ||||
if (vm_resume_user_devs() != 0) { | if (vm_resume_devices() != 0) { | ||||
fprintf(stderr, "Failed to resume PCI device state.\n"); | fprintf(stderr, "Failed to resume PCI device state.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
error = vm_get_register(bsp, VM_REG_GUEST_RIP, &rip); | error = vm_get_register(bsp, VM_REG_GUEST_RIP, &rip); | ||||
assert(error == 0); | assert(error == 0); | ||||
Show All 12 Lines |