Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyveload/bhyveload.c
Show First 20 Lines • Show All 554 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t base, u_int limit, | cb_vm_set_desc(void *arg, int vcpu, int reg, uint64_t base, u_int limit, | ||||
u_int access) | u_int access) | ||||
{ | { | ||||
return (vm_set_desc(ctx, vcpu, reg, base, limit, access)); | return (vm_set_desc(ctx, vcpu, reg, base, limit, access)); | ||||
} | } | ||||
static int | |||||
cb_vm_get_unrestricted_guest(void* arg, int vcpu, int *retval) | |||||
{ | |||||
grehan: Minor style(9) - should be an empty line before the rreturn - see the routine above. | |||||
return (vm_get_capability(ctx, vcpu, | |||||
Done Inline ActionsMinor style(9) - continued lines should be indented by 4 spaces. grehan: Minor style(9) - continued lines should be indented by 4 spaces. | |||||
VM_CAP_UNRESTRICTED_GUEST, retval)); | |||||
} | |||||
static int | |||||
cb_vm_set_unrestricted_guest(void* arg, int vcpu, int val) | |||||
{ | |||||
int error, tmp; | |||||
Done Inline ActionsMinor style(9) - blank line between declarations and statement. grehan: Minor style(9) - blank line between declarations and statement. | |||||
Done Inline ActionsMinor style(9) - return expression should be enclosed in parens. grehan: Minor style(9) - return expression should be enclosed in parens. | |||||
if ((error = cb_vm_get_unrestricted_guest(arg, vcpu, &tmp))) | |||||
return (error); | |||||
return (vm_set_capability(ctx, vcpu, | |||||
VM_CAP_UNRESTRICTED_GUEST, val)); | |||||
} | |||||
static int | |||||
cb_vcpu_reset(void* arg, int vcpu) | |||||
Done Inline ActionsMinor style(9) - blank line needed before statement, and return expression should be in parens. grehan: Minor style(9) - blank line needed before statement, and return expression should be in parens. | |||||
{ | |||||
return (vcpu_reset(ctx, vcpu)); | |||||
} | |||||
static struct loader_callbacks cb = { | static struct loader_callbacks cb = { | ||||
.getc = cb_getc, | .getc = cb_getc, | ||||
.putc = cb_putc, | .putc = cb_putc, | ||||
.poll = cb_poll, | .poll = cb_poll, | ||||
.open = cb_open, | .open = cb_open, | ||||
.close = cb_close, | .close = cb_close, | ||||
.isdir = cb_isdir, | .isdir = cb_isdir, | ||||
Show All 17 Lines | static struct loader_callbacks cb = { | ||||
.exit = cb_exit, | .exit = cb_exit, | ||||
.getmem = cb_getmem, | .getmem = cb_getmem, | ||||
.getenv = cb_getenv, | .getenv = cb_getenv, | ||||
/* Version 4 additions */ | /* Version 4 additions */ | ||||
.vm_set_register = cb_vm_set_register, | .vm_set_register = cb_vm_set_register, | ||||
.vm_set_desc = cb_vm_set_desc, | .vm_set_desc = cb_vm_set_desc, | ||||
/* Version 5 additions */ | |||||
.vm_set_unrestricted_guest = cb_vm_set_unrestricted_guest, | |||||
.vm_get_unrestricted_guest = cb_vm_get_unrestricted_guest, | |||||
.vcpu_reset = cb_vcpu_reset, | |||||
}; | }; | ||||
static int | static int | ||||
altcons_open(char *path) | altcons_open(char *path) | ||||
{ | { | ||||
struct stat sb; | struct stat sb; | ||||
int err; | int err; | ||||
int fd; | int fd; | ||||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Lines | main(int argc, char** argv) | ||||
cfmakeraw(&term); | cfmakeraw(&term); | ||||
term.c_cflag |= CLOCAL; | term.c_cflag |= CLOCAL; | ||||
tcsetattr(consout_fd, TCSAFLUSH, &term); | tcsetattr(consout_fd, TCSAFLUSH, &term); | ||||
addenv("smbios.bios.vendor=BHYVE"); | addenv("smbios.bios.vendor=BHYVE"); | ||||
addenv("boot_serial=1"); | addenv("boot_serial=1"); | ||||
func(&cb, NULL, USERBOOT_VERSION_4, ndisks); | func(&cb, NULL, USERBOOT_VERSION_5, ndisks); | ||||
free(loader); | free(loader); | ||||
return (0); | return (0); | ||||
} | } |
Minor style(9) - should be an empty line before the rreturn - see the routine above.