Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/bhyverun.c
Show First 20 Lines • Show All 756 Lines • ▼ Show 20 Lines | |||||
memflags = 0; | memflags = 0; | ||||
if (get_config_bool_default("memory.wired", false)) | if (get_config_bool_default("memory.wired", false)) | ||||
memflags |= VM_MEM_F_WIRED; | memflags |= VM_MEM_F_WIRED; | ||||
if (get_config_bool_default("memory.guest_in_core", false)) | if (get_config_bool_default("memory.guest_in_core", false)) | ||||
memflags |= VM_MEM_F_INCORE; | memflags |= VM_MEM_F_INCORE; | ||||
vm_set_memflags(ctx, memflags); | vm_set_memflags(ctx, memflags); | ||||
error = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); | error = vm_setup_memory(ctx, memsize, VM_MMAP_ALL); | ||||
if (error) { | if (error) { | ||||
corvink: I'd split this patch into multiple ones. E.g. this change is unrelated to the fd part. So, it… | |||||
Done Inline Actionsgusev.vitaliy_gmail.com: Done: https://reviews.freebsd.org/D38836 | |||||
fprintf(stderr, "Unable to setup memory (%d)\n", errno); | fprintf(stderr, "Unable to setup memory (%d)\n", errno); | ||||
exit(4); | exit(4); | ||||
} | } | ||||
error = init_msr(); | error = init_msr(); | ||||
if (error) { | if (error) { | ||||
fprintf(stderr, "init_msr error %d", error); | fprintf(stderr, "init_msr error %d", error); | ||||
exit(4); | exit(4); | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
if (lpc_bootrom()) | if (lpc_bootrom()) | ||||
fwctl_init(); | fwctl_init(); | ||||
/* | /* | ||||
* Change the proc title to include the VM name. | * Change the proc title to include the VM name. | ||||
*/ | */ | ||||
setproctitle("%s", vmname); | setproctitle("%s", vmname); | ||||
#ifdef BHYVE_SNAPSHOT | |||||
/* initialize mutex/cond variables */ | |||||
init_snapshot(); | |||||
/* | |||||
* checkpointing thread for communication with bhyvectl | |||||
*/ | |||||
if (init_checkpoint_thread(ctx) < 0) | |||||
errx(EX_OSERR, "Failed to start checkpoint thread"); | |||||
#endif | |||||
Done Inline ActionsCreate a seperate commit and explain why the move is required. corvink: Create a seperate commit and explain why the move is required. | |||||
Done Inline Actionsgusev.vitaliy_gmail.com: Done. https://reviews.freebsd.org/D38857
| |||||
#ifndef WITHOUT_CAPSICUM | #ifndef WITHOUT_CAPSICUM | ||||
caph_cache_catpages(); | caph_cache_catpages(); | ||||
if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) | if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) | ||||
errx(EX_OSERR, "Unable to apply rights for sandbox"); | errx(EX_OSERR, "Unable to apply rights for sandbox"); | ||||
if (caph_enter() == -1) | if (caph_enter() == -1) | ||||
errx(EX_OSERR, "cap_enter() failed"); | errx(EX_OSERR, "cap_enter() failed"); | ||||
#endif | #endif | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
/* initialize mutex/cond variables */ | |||||
init_snapshot(); | |||||
/* | |||||
* checkpointing thread for communication with bhyvectl | |||||
*/ | |||||
if (init_checkpoint_thread(ctx) < 0) | |||||
printf("Failed to start checkpoint thread!\r\n"); | |||||
if (restore_file != NULL) { | if (restore_file != NULL) { | ||||
destroy_restore_state(&rstate); | destroy_restore_state(&rstate); | ||||
vm_restore_time(ctx); | if (vm_restore_time(ctx) < 0) | ||||
err(EX_OSERR, "Unable to restore time"); | |||||
Done Inline ActionsThis is unrelated to capsicum and should be a seperate commit. corvink: This is unrelated to capsicum and should be a seperate commit. | |||||
Done Inline Actionsgusev.vitaliy_gmail.com: Done. https://reviews.freebsd.org/D38872 | |||||
for (int i = 0; i < guest_ncpus; i++) { | for (int i = 0; i < guest_ncpus; i++) { | ||||
if (i == BSP) | if (i == BSP) | ||||
continue; | continue; | ||||
vm_resume_cpu(ctx, i); | vm_resume_cpu(ctx, i); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
Show All 9 Lines |
I'd split this patch into multiple ones. E.g. this change is unrelated to the fd part. So, it should be a seperate commits and can be merged early.