diff options
-rw-r--r-- | usr.sbin/vmd/pci.c | 4 | ||||
-rw-r--r-- | usr.sbin/vmd/virtio.c | 22 | ||||
-rw-r--r-- | usr.sbin/vmd/vmm.c | 8 |
3 files changed, 17 insertions, 17 deletions
diff --git a/usr.sbin/vmd/pci.c b/usr.sbin/vmd/pci.c index 613d7574d68..e1f76bd8a14 100644 --- a/usr.sbin/vmd/pci.c +++ b/usr.sbin/vmd/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.4 2015/12/03 08:42:11 reyk Exp $ */ +/* $OpenBSD: pci.c,v 1.5 2016/01/04 02:07:28 mlarkin Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -170,7 +170,7 @@ pci_init(void) { uint8_t id; - bzero(&pci, sizeof(pci)); + memset(&pci, 0, sizeof(pci)); pci.pci_next_mmio_bar = VMM_PCI_MMIO_BAR_BASE; pci.pci_next_io_bar = VMM_PCI_IO_BAR_BASE; diff --git a/usr.sbin/vmd/virtio.c b/usr.sbin/vmd/virtio.c index 7a1233307ed..4c2f7336fea 100644 --- a/usr.sbin/vmd/virtio.c +++ b/usr.sbin/vmd/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.5 2016/01/03 22:36:09 mlarkin Exp $ */ +/* $OpenBSD: virtio.c,v 1.6 2016/01/04 02:07:28 mlarkin Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -185,7 +185,7 @@ viornd_notifyq(void) return (0); } - bzero(buf, vr_sz); + memset(buf, 0, vr_sz); for (i = 0; i < vr_sz; i += VIRTIO_PAGE_SIZE) { if (read_page((uint32_t)q_gpa + i, buf + i, PAGE_SIZE, 0)) { @@ -400,7 +400,7 @@ vioblk_notifyq(struct vioblk_dev *dev) return (0); } - bzero(vr, vr_sz); + memset(vr, 0, vr_sz); for (i = 0; i < vr_sz; i += VIRTIO_PAGE_SIZE) { if (read_page((uint32_t)q_gpa + i, vr + i, PAGE_SIZE, 0)) { @@ -847,7 +847,7 @@ vionet_enq_rx(struct vionet_dev *dev, char *pkt, ssize_t sz, int *spc) return (0); } - bzero(vr, vr_sz); + memset(vr, 0, vr_sz); for (i = 0; i < vr_sz; i += VIRTIO_PAGE_SIZE) { if (read_page((uint32_t)q_gpa + i, vr + i, PAGE_SIZE, 0)) { @@ -927,8 +927,8 @@ vionet_process_rx(void) spc = 1; hasdata = 1; - bzero(buf, PAGE_SIZE); - bzero(&pfd, sizeof(struct pollfd)); + memset(buf, 0, PAGE_SIZE); + memset(&pfd, 0, sizeof(struct pollfd)); pfd.fd = vionet[i].fd; pfd.events = POLLIN; while (spc && hasdata) { @@ -976,7 +976,7 @@ vionet_notify_rx(struct vionet_dev *dev) return; } - bzero(vr, vr_sz); + memset(vr, 0, vr_sz); for (i = 0; i < vr_sz; i += VIRTIO_PAGE_SIZE) { if (read_page((uint32_t)q_gpa + i, vr + i, PAGE_SIZE, 0)) { @@ -1040,7 +1040,7 @@ vionet_notifyq(struct vionet_dev *dev) goto out; } - bzero(vr, vr_sz); + memset(vr, 0, vr_sz); for (i = 0; i < vr_sz; i += VIRTIO_PAGE_SIZE) { if (read_page((uint32_t)q_gpa + i, vr + i, PAGE_SIZE, 0)) { @@ -1189,7 +1189,7 @@ virtio_init(struct vm_create_params *vcp, int *child_disks, int *child_taps) return; } - bzero(&viornd, sizeof(viornd)); + memset(&viornd, 0, sizeof(viornd)); viornd.vq[0].qs = VIORND_QUEUE_SIZE; viornd.vq[0].vq_availoffset = sizeof(struct vring_desc) * VIORND_QUEUE_SIZE; @@ -1205,7 +1205,7 @@ virtio_init(struct vm_create_params *vcp, int *child_disks, int *child_taps) return; } - bzero(vioblk, sizeof(struct vioblk_dev) * vcp->vcp_ndisks); + memset(vioblk, 0, sizeof(struct vioblk_dev) * vcp->vcp_ndisks); /* One virtio block device for each disk defined in vcp */ for (i = 0; i < vcp->vcp_ndisks; i++) { @@ -1245,7 +1245,7 @@ virtio_init(struct vm_create_params *vcp, int *child_disks, int *child_taps) return; } - bzero(vionet, sizeof(struct vionet_dev) * vcp->vcp_nnics); + memset(vionet, 0, sizeof(struct vionet_dev) * vcp->vcp_nnics); nr_vionet = vcp->vcp_nnics; /* Virtio network */ diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c index 7b405dc988f..5988fb665ed 100644 --- a/usr.sbin/vmd/vmm.c +++ b/usr.sbin/vmd/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.14 2015/12/17 09:29:28 mlarkin Exp $ */ +/* $OpenBSD: vmm.c,v 1.15 2016/01/04 02:07:28 mlarkin Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -666,7 +666,7 @@ init_emulated_hw(struct vm_create_params *vcp, int *child_disks, int *child_taps) { /* Init the i8253 PIT's 3 counters */ - bzero(&i8253_counter, sizeof(struct i8253_counter) * 3); + memset(&i8253_counter, 0, sizeof(struct i8253_counter) * 3); gettimeofday(&i8253_counter[0].tv, NULL); gettimeofday(&i8253_counter[1].tv, NULL); gettimeofday(&i8253_counter[2].tv, NULL); @@ -675,7 +675,7 @@ init_emulated_hw(struct vm_create_params *vcp, int *child_disks, i8253_counter[2].start = TIMER_DIV(100); /* Init ns8250 UART */ - bzero(&com1_regs, sizeof(struct ns8250_regs)); + memset(&com1_regs, 0, sizeof(struct ns8250_regs)); /* Initialize PCI */ pci_init(); @@ -778,7 +778,7 @@ run_vm(int *child_disks, int *child_taps, struct vm_create_params *vcp, log_warnx("%s: vm %d vcpu run thread %zd exited " "abnormally", __progname, vcp->vcp_id, i); /* Terminate the VM if we can */ - bzero(&vtp, sizeof(vtp)); + memset(&vtp, 0, sizeof(vtp)); vtp.vtp_vm_id = vcp->vcp_id; if (terminate_vm(&vtp)) { log_warnx("%s: could not terminate vm %d", |