diff options
author | 2017-01-17 21:51:01 +0000 | |
---|---|---|
committer | 2017-01-17 21:51:01 +0000 | |
commit | 24c50ede7c0f8788ecd1142dfca7f35b4c172cb0 (patch) | |
tree | c61d4fa4175602b9e87623a315a502e430063a4e /usr.sbin/vmd | |
parent | "hosts" is optional; from matthew martin (diff) | |
download | wireguard-openbsd-24c50ede7c0f8788ecd1142dfca7f35b4c172cb0.tar.xz wireguard-openbsd-24c50ede7c0f8788ecd1142dfca7f35b4c172cb0.zip |
Nuke some whitespace that keeps poking me in the eye as I try to
steal code.
Diffstat (limited to 'usr.sbin/vmd')
-rw-r--r-- | usr.sbin/vmd/config.c | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/control.c | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/i8253.c | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/i8259.c | 19 | ||||
-rw-r--r-- | usr.sbin/vmd/loadfile_elf.c | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/mc146818.c | 6 | ||||
-rw-r--r-- | usr.sbin/vmd/pci.c | 6 | ||||
-rw-r--r-- | usr.sbin/vmd/proc.c | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/virtio.c | 6 | ||||
-rw-r--r-- | usr.sbin/vmd/vmm.c | 16 |
10 files changed, 36 insertions, 37 deletions
diff --git a/usr.sbin/vmd/config.c b/usr.sbin/vmd/config.c index e1b3e18def5..f35a3b3562d 100644 --- a/usr.sbin/vmd/config.c +++ b/usr.sbin/vmd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.22 2016/12/14 06:59:12 reyk Exp $ */ +/* $OpenBSD: config.c,v 1.23 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> @@ -338,7 +338,7 @@ config_getdisk(struct privsep *ps, struct imsg *imsg) { struct vmd_vm *vm; unsigned int n; - + errno = 0; if ((vm = vm_getbyvmid(imsg->hdr.peerid)) == NULL) { errno = ENOENT; diff --git a/usr.sbin/vmd/control.c b/usr.sbin/vmd/control.c index 9868efb8f9c..5e0141f598a 100644 --- a/usr.sbin/vmd/control.c +++ b/usr.sbin/vmd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.12 2017/01/09 22:06:25 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.13 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2010-2015 Reyk Floeter <reyk@openbsd.org> @@ -66,7 +66,7 @@ control_run(struct privsep *ps, struct privsep_proc *p, void *arg) { /* * pledge in the control process: - * stdio - for malloc and basic I/O including events. + * stdio - for malloc and basic I/O including events. * cpath - for managing the control socket. * unix - for the control socket. * recvfd - for the proc fd exchange. diff --git a/usr.sbin/vmd/i8253.c b/usr.sbin/vmd/i8253.c index f3daf5449b9..c3e83dec434 100644 --- a/usr.sbin/vmd/i8253.c +++ b/usr.sbin/vmd/i8253.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i8253.c,v 1.4 2016/10/26 05:26:36 mlarkin Exp $ */ +/* $OpenBSD: i8253.c,v 1.5 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org> * @@ -241,6 +241,6 @@ i8253_fire(int fd, short type, void *arg) tv.tv_usec = (i8253_counter[0].start * NS_PER_TICK) / 1000; vcpu_assert_pic_irq((ptrdiff_t)arg, 0, 0); - + evtimer_add(&i8253_counter[0].timer, &tv); } diff --git a/usr.sbin/vmd/i8259.c b/usr.sbin/vmd/i8259.c index 16d65710c20..04e42e2c4ed 100644 --- a/usr.sbin/vmd/i8259.c +++ b/usr.sbin/vmd/i8259.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i8259.c,v 1.4 2016/11/20 22:54:40 mlarkin Exp $ */ +/* $OpenBSD: i8259.c,v 1.5 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org> * @@ -84,7 +84,7 @@ i8259_is_pending(void) pending = 1; return pending; -} +} /* * i8259_ack @@ -195,7 +195,7 @@ i8259_assert_irq(uint8_t irq) pics[MASTER].irr |= (1 << 2); pics[MASTER].asserted = 1; } -} +} /* * i8259_deassert_irq @@ -253,32 +253,32 @@ i8259_write_datareg(uint8_t n, uint8_t data) "clear", __func__, n); return; } - + if (data & ICW4_AEOI) { log_warn("%s: pic %d: aeoi mode set", __func__, n); pic->auto_eoi = 1; return; } - + if (data & ICW4_MS) { log_warn("%s: pic %d init error: M/S mode", __func__, n); return; } - + if (data & ICW4_BUF) { log_warn("%s: pic %d init error: buf mode", __func__, n); return; } - + if (data & 0xe0) { log_warn("%s: pic %d init error: invalid icw4 " " 0x%x", __func__, n, data); return; } - } + } pic->cur_icw++; if (pic->cur_icw == 5) { @@ -348,7 +348,7 @@ i8259_rotate_priority(uint8_t n) * Parameters: * n: PIC whose command register should be written to * data: data to write - */ + */ static void i8259_write_cmdreg(uint8_t n, uint8_t data) { @@ -550,7 +550,6 @@ i8259_io_write(union vm_exit *vei) i8259_write_datareg(n, data); else i8259_write_cmdreg(n, data); - } /* diff --git a/usr.sbin/vmd/loadfile_elf.c b/usr.sbin/vmd/loadfile_elf.c index 645bfc3ec00..81c00cfcca2 100644 --- a/usr.sbin/vmd/loadfile_elf.c +++ b/usr.sbin/vmd/loadfile_elf.c @@ -1,5 +1,5 @@ /* $NetBSD: loadfile.c,v 1.10 2000/12/03 02:53:04 tsutsui Exp $ */ -/* $OpenBSD: loadfile_elf.c,v 1.22 2016/11/26 20:03:42 reyk Exp $ */ +/* $OpenBSD: loadfile_elf.c,v 1.23 2017/01/17 21:51:01 krw Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -233,7 +233,7 @@ push_pt(void) memset(ptes, 0, sizeof(ptes)); for (i = 0 ; i < NPTE_PG; i++) { ptes[i] = PG_V | PG_PS | (NBPD * i); - } + } write_mem(PML4_PAGE, ptes, PAGE_SIZE); #else /* PML3 [0] - first 1GB */ diff --git a/usr.sbin/vmd/mc146818.c b/usr.sbin/vmd/mc146818.c index b77c1617be0..e6c868900ca 100644 --- a/usr.sbin/vmd/mc146818.c +++ b/usr.sbin/vmd/mc146818.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mc146818.c,v 1.4 2016/10/26 05:26:36 mlarkin Exp $ */ +/* $OpenBSD: mc146818.c,v 1.5 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2016 Mike Larkin <mlarkin@openbsd.org> * @@ -130,7 +130,7 @@ void mc146818_init(uint32_t vm_id) { memset(&rtc, 0, sizeof(rtc)); - time(&rtc.now); + time(&rtc.now); rtc.regs[MC_REGB] = MC_REGB_24HR | MC_REGB_BINARY; rtc_updateregs(); @@ -270,7 +270,7 @@ vcpu_exit_mc146818(struct vm_run_params *vrp) } rtc.idx = MC_REGD; } else { - data = rtc.regs[rtc.idx]; + data = rtc.regs[rtc.idx]; vei->vei.vei_data = data; if (rtc.idx == MC_REGC) { diff --git a/usr.sbin/vmd/pci.c b/usr.sbin/vmd/pci.c index 7e03f64d58e..1352995dad9 100644 --- a/usr.sbin/vmd/pci.c +++ b/usr.sbin/vmd/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.11 2017/01/13 14:50:56 reyk Exp $ */ +/* $OpenBSD: pci.c,v 1.12 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -40,7 +40,7 @@ const uint8_t pci_pic_irqs[PCI_MAX_PIC_IRQS] = {3, 5, 7, 9, 10, 11, 14, 15}; * Adds a BAR for the PCI device 'id'. On access, 'barfn' will be * called, and passed 'cookie' as an identifier. * - * BARs are fixed size, meaning all I/O BARs requested have the + * BARs are fixed size, meaning all I/O BARs requested have the * same size and all MMIO BARs have the same size. * * Parameters: @@ -267,7 +267,7 @@ pci_handle_io(struct vm_run_params *vrp) __progname, (uint64_t)reg); /* Reads from undefined ports return 0xFF */ if (dir == 1) - vei->vei.vei_data = 0xFFFFFFFF; + vei->vei.vei_data = 0xFFFFFFFF; } if (intr != 0xFF) { diff --git a/usr.sbin/vmd/proc.c b/usr.sbin/vmd/proc.c index 5248491d08c..1c2a044ade6 100644 --- a/usr.sbin/vmd/proc.c +++ b/usr.sbin/vmd/proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.c,v 1.12 2017/01/09 14:49:22 reyk Exp $ */ +/* $OpenBSD: proc.c,v 1.13 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2010 - 2016 Reyk Floeter <reyk@openbsd.org> @@ -208,7 +208,7 @@ proc_init(struct privsep *ps, struct privsep_proc *procs, unsigned int nproc, proc_setup(ps, procs, nproc); /* - * Create the children sockets so we can use them + * Create the children sockets so we can use them * to distribute the rest of the socketpair()s using * proc_connect() later. */ diff --git a/usr.sbin/vmd/virtio.c b/usr.sbin/vmd/virtio.c index 8e4ea507317..0bd6fb3374d 100644 --- a/usr.sbin/vmd/virtio.c +++ b/usr.sbin/vmd/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.28 2017/01/13 15:12:13 reyk Exp $ */ +/* $OpenBSD: virtio.c,v 1.29 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -1419,9 +1419,9 @@ virtio_init(struct vm_create_params *vcp, int *child_disks, int *child_taps) } else { /* * If the address is zero, always randomize - * it in vmd(8) because we cannot rely on + * it in vmd(8) because we cannot rely on * the guest OS to do the right thing like - * OpenBSD does. Based on ether_fakeaddr() + * OpenBSD does. Based on ether_fakeaddr() * from the kernel, incremented by one to * differentiate the source. */ diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c index dd084ed704f..0cc547beab1 100644 --- a/usr.sbin/vmd/vmm.c +++ b/usr.sbin/vmd/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.63 2017/01/13 14:50:56 reyk Exp $ */ +/* $OpenBSD: vmm.c,v 1.64 2017/01/17 21:51:01 krw Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -166,7 +166,7 @@ vmm_run(struct privsep *ps, struct privsep_proc *p, void *arg) /* * pledge in the vmm process: - * stdio - for malloc and basic I/O including events. + * stdio - for malloc and basic I/O including events. * vmm - for the vmm ioctls and operations. * proc - for forking and maitaining vms. * recvfd - for disks, interfaces and other fds. @@ -368,7 +368,7 @@ vmm_sighdlr(int sig, short event, void *arg) /* * vmm_shutdown - * + * * Terminate VMs on shutdown to avoid "zombie VM" processes. */ void @@ -728,7 +728,7 @@ start_vm(struct imsg *imsg, uint32_t *id) /* * pledge in the vm processes: - * stdio - for malloc and basic I/O including events. + * stdio - for malloc and basic I/O including events. * vmm - for the vmm ioctls and operations. */ if (pledge("stdio vmm", NULL) == -1) @@ -737,7 +737,7 @@ start_vm(struct imsg *imsg, uint32_t *id) /* * Set up default "flat 32 bit" register state - RIP, * RSP, and GDT info will be set in bootloader - */ + */ memcpy(&vrs, &vcpu_init_flat32, sizeof(struct vcpu_reg_state)); /* Find and open kernel image */ @@ -1025,7 +1025,7 @@ init_emulated_hw(struct vm_create_params *vcp, int *child_disks, /* Reset the IO port map */ memset(&ioports_map, 0, sizeof(io_fn_t) * MAX_PORTS); - + /* Init i8253 PIT */ i8253_init(vcp->vcp_id); ioports_map[TIMER_CTRL] = vcpu_exit_i8253; @@ -1053,7 +1053,7 @@ init_emulated_hw(struct vm_create_params *vcp, int *child_disks, /* Initialize PCI */ for (i = VMM_PCI_IO_BAR_BASE; i <= VMM_PCI_IO_BAR_END; i++) ioports_map[i] = vcpu_exit_pci; - + ioports_map[PCI_MODE1_ADDRESS_REG] = vcpu_exit_pci; ioports_map[PCI_MODE1_DATA_REG] = vcpu_exit_pci; pci_init(); @@ -1453,7 +1453,7 @@ vcpu_exit_inout(struct vm_run_params *vrp) intr = ioports_map[vei->vei.vei_port](vrp); else if (vei->vei.vei_dir == VEI_DIR_IN) vei->vei.vei_data = 0xFFFFFFFF; - + if (intr != 0xFF) vcpu_assert_pic_irq(vrp->vrp_vm_id, vrp->vrp_vcpu_id, intr); } |