diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-09-14 10:07:18 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2017-09-14 10:07:18 +0000 |
commit | 55b3f0ab8b5862e05a1ed64be94f8fc19f671a1f (patch) | |
tree | 328ca2018162dc70661ef65f7bd16a40e1122d08 | |
parent | 8523605d5363627b6c3483b44d10ae57de382564 (diff) |
spacing
-rw-r--r-- | usr.sbin/vmd/config.c | 26 | ||||
-rw-r--r-- | usr.sbin/vmd/vmm.c | 7 |
2 files changed, 17 insertions, 16 deletions
diff --git a/usr.sbin/vmd/config.c b/usr.sbin/vmd/config.c index d39f3635c75..3f51d24e0f2 100644 --- a/usr.sbin/vmd/config.c +++ b/usr.sbin/vmd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.35 2017/09/08 06:24:31 mlarkin Exp $ */ +/* $OpenBSD: config.c,v 1.36 2017/09/14 10:07:17 reyk Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -92,7 +92,7 @@ config_purge(struct vmd *env, unsigned int reset) while ((vm = TAILQ_FIRST(env->vmd_vms)) != NULL) { log_debug("%s: calling vm_remove", __func__); vm_remove(vm); - } + } env->vmd_nvm = 0; } if (what & CONFIG_SWITCHES && env->vmd_switches != NULL) { @@ -204,16 +204,18 @@ config_setvm(struct privsep *ps, struct vmd_vm *vm, uint32_t peerid, uid_t uid) if (!vm->vm_received) { if (strlen(vcp->vcp_kernel)) { - /* Boot kernel from disk image if path matches the root - * disk */ + /* + * Boot kernel from disk image if path matches the + * root disk. + */ if (vcp->vcp_ndisks && strcmp(vcp->vcp_kernel, vcp->vcp_disks[0]) == 0) vmboot = 1; /* Open external kernel for child */ - else if ((kernfd = open(vcp->vcp_kernel, O_RDONLY)) == - -1) { - log_warn("%s: can't open kernel/BIOS boot image\ - %s", __func__, vcp->vcp_kernel); + else if ((kernfd = + open(vcp->vcp_kernel, O_RDONLY)) == -1) { + log_warn("%s: can't open kernel or BIOS " + "boot image %s", __func__, vcp->vcp_kernel); goto fail; } } @@ -236,18 +238,18 @@ config_setvm(struct privsep *ps, struct vmd_vm *vm, uint32_t peerid, uid_t uid) /* Open disk images for child */ for (i = 0 ; i < vcp->vcp_ndisks; i++) { /* Stat disk[i] to ensure it is a regular file */ - if (stat(vcp->vcp_disks[i], &stat_buf) == -1) { + if (stat(vcp->vcp_disks[i], &stat_buf) == -1) { log_warn("%s: can't open disk %s", __func__, vcp->vcp_disks[i]); errno = VMD_DISK_MISSING; goto fail; - } - if (S_ISREG(stat_buf.st_mode) == 0) { + } + if (S_ISREG(stat_buf.st_mode) == 0) { log_warn("%s: disk %s is not a regular file", __func__, vcp->vcp_disks[i]); errno = VMD_DISK_INVALID; goto fail; - } + } if ((diskfds[i] = open(vcp->vcp_disks[i], O_RDWR)) == -1) { log_warn("%s: can't open disk %s", __func__, diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c index 00b0b1f1d7b..ccd7680b479 100644 --- a/usr.sbin/vmd/vmm.c +++ b/usr.sbin/vmd/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.75 2017/09/08 07:08:49 mlarkin Exp $ */ +/* $OpenBSD: vmm.c,v 1.76 2017/09/14 10:07:17 reyk Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -490,7 +490,7 @@ vmm_dispatch_vm(int fd, short event, void *arg) case IMSG_VMDOP_SEND_VM_RESPONSE: IMSG_SIZE_CHECK(&imsg, &vmr); memcpy(&vmr, imsg.data, sizeof(vmr)); - if(!vmr.vmr_result) { + if (!vmr.vmr_result) { log_debug("%s: calling vm_remove", __func__); vm_remove(vm); } @@ -499,8 +499,7 @@ vmm_dispatch_vm(int fd, short event, void *arg) for (i = 0; i < sizeof(procs); i++) { if (procs[i].p_id == PROC_PARENT) { proc_forward_imsg(procs[i].p_ps, - &imsg, PROC_PARENT, - -1); + &imsg, PROC_PARENT, -1); break; } } |