From 1f5e00e09e5c77e5b4bdd78a462b52970f264d36 Mon Sep 17 00:00:00 2001 From: reyk Date: Tue, 10 Jul 2018 20:43:15 +0000 Subject: [PATCH] vmd already had DEBUG/DPRINTF, there is no need for VMD_DEBUG/dprintf Replace all occurences of dprintf with DPRINTF (defined in proc.h). --- usr.sbin/vmd/pci.c | 6 +++--- usr.sbin/vmd/vioscsi.c | 46 +++++++++++++++++++++--------------------- usr.sbin/vmd/vmd.c | 6 +++--- usr.sbin/vmd/vmd.h | 8 +------- usr.sbin/vmd/vmm.c | 4 ++-- 5 files changed, 32 insertions(+), 38 deletions(-) diff --git a/usr.sbin/vmd/pci.c b/usr.sbin/vmd/pci.c index 3372e9e2a37..6395c981a2e 100644 --- a/usr.sbin/vmd/pci.c +++ b/usr.sbin/vmd/pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci.c,v 1.25 2018/06/19 17:12:34 reyk Exp $ */ +/* $OpenBSD: pci.c,v 1.26 2018/07/10 20:43:15 reyk Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -95,7 +95,7 @@ pci_add_bar(uint8_t id, uint32_t type, void *barfn, void *cookie) pci.pci_next_io_bar += VMM_PCI_IO_BAR_SIZE; pci.pci_devices[id].pd_barfunc[bar_ct] = barfn; pci.pci_devices[id].pd_bar_cookie[bar_ct] = cookie; - dprintf("%s: adding pci bar cookie for dev %d bar %d = %p", + DPRINTF("%s: adding pci bar cookie for dev %d bar %d = %p", __progname, id, bar_ct, cookie); pci.pci_devices[id].pd_bartype[bar_ct] = PCI_BAR_TYPE_IO; pci.pci_devices[id].pd_barsize[bar_ct] = VMM_PCI_IO_BAR_SIZE; @@ -192,7 +192,7 @@ pci_add_device(uint8_t *id, uint16_t vid, uint16_t pid, uint8_t class, pci_pic_irqs[pci.pci_next_pic_irq]; pci.pci_devices[*id].pd_int = 1; pci.pci_next_pic_irq++; - dprintf("assigned irq %d to pci dev %d", + DPRINTF("assigned irq %d to pci dev %d", pci.pci_devices[*id].pd_irq, *id); pic_set_elcr(pci.pci_devices[*id].pd_irq, 1); } diff --git a/usr.sbin/vmd/vioscsi.c b/usr.sbin/vmd/vioscsi.c index 3e060628e19..f8b44a72a85 100644 --- a/usr.sbin/vmd/vioscsi.c +++ b/usr.sbin/vmd/vioscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioscsi.c,v 1.6 2018/06/19 17:12:34 reyk Exp $ */ +/* $OpenBSD: vioscsi.c,v 1.7 2018/07/10 20:43:15 reyk Exp $ */ /* * Copyright (c) 2017 Carlos Cardenas @@ -287,7 +287,7 @@ vioscsi_handle_inquiry(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -301,7 +301,7 @@ vioscsi_handle_inquiry(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing inq_data to 0x%llx size %d at " + DPRINTF("%s: writing inq_data to 0x%llx size %d at " "local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -397,7 +397,7 @@ vioscsi_handle_mode_sense(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d " + DPRINTF("%s: writing resp to 0x%llx size %d " "at local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -415,7 +415,7 @@ vioscsi_handle_mode_sense(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing mode_reply to 0x%llx " + DPRINTF("%s: writing mode_reply to 0x%llx " "size %d at local idx %d req_idx %d " "global_idx %d",__func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, @@ -540,7 +540,7 @@ vioscsi_handle_mode_sense_big(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d " + DPRINTF("%s: writing resp to 0x%llx size %d " "at local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -558,7 +558,7 @@ vioscsi_handle_mode_sense_big(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing mode_reply to 0x%llx " + DPRINTF("%s: writing mode_reply to 0x%llx " "size %d at local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -657,7 +657,7 @@ vioscsi_handle_read_capacity(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -672,7 +672,7 @@ vioscsi_handle_read_capacity(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing r_cap_data to 0x%llx size %d at " + DPRINTF("%s: writing r_cap_data to 0x%llx size %d at " "local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -732,7 +732,7 @@ vioscsi_handle_read_capacity_16(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -747,7 +747,7 @@ vioscsi_handle_read_capacity_16(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing r_cap_data_16 to 0x%llx size %d " + DPRINTF("%s: writing r_cap_data_16 to 0x%llx size %d " "at local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -833,7 +833,7 @@ vioscsi_handle_report_luns(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -847,7 +847,7 @@ vioscsi_handle_report_luns(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing reply_rpl to 0x%llx size %d at " + DPRINTF("%s: writing reply_rpl to 0x%llx size %d at " "local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -960,7 +960,7 @@ vioscsi_handle_read_6(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -975,7 +975,7 @@ vioscsi_handle_read_6(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing read_buf to 0x%llx size %d at " + DPRINTF("%s: writing read_buf to 0x%llx size %d at " "local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1089,7 +1089,7 @@ vioscsi_handle_read_10(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1111,7 +1111,7 @@ vioscsi_handle_read_10(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing read_buf to 0x%llx size " + DPRINTF("%s: writing read_buf to 0x%llx size " "%d at local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1338,7 +1338,7 @@ vioscsi_handle_read_toc(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1353,7 +1353,7 @@ vioscsi_handle_read_toc(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing toc_data to 0x%llx size %d at " + DPRINTF("%s: writing toc_data to 0x%llx size %d at " "local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1471,7 +1471,7 @@ vioscsi_handle_gesn(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1486,7 +1486,7 @@ vioscsi_handle_gesn(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing gesn_reply to 0x%llx size %d at " + DPRINTF("%s: writing gesn_reply to 0x%llx size %d at " "local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1616,7 +1616,7 @@ vioscsi_handle_get_config(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->req_desc, &(acct->resp_idx)); - dprintf("%s: writing resp to 0x%llx size %d at local " + DPRINTF("%s: writing resp to 0x%llx size %d at local " "idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); @@ -1632,7 +1632,7 @@ vioscsi_handle_get_config(struct vioscsi_dev *dev, acct->resp_desc = vioscsi_next_ring_desc(acct->desc, acct->resp_desc, &(acct->resp_idx)); - dprintf("%s: writing get_conf_reply to 0x%llx size %d " + DPRINTF("%s: writing get_conf_reply to 0x%llx size %d " "at local idx %d req_idx %d global_idx %d", __func__, acct->resp_desc->addr, acct->resp_desc->len, acct->resp_idx, acct->req_idx, acct->idx); diff --git a/usr.sbin/vmd/vmd.c b/usr.sbin/vmd/vmd.c index 5f81cab8986..75df10fc466 100644 --- a/usr.sbin/vmd/vmd.c +++ b/usr.sbin/vmd/vmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.c,v 1.88 2018/07/10 16:15:51 reyk Exp $ */ +/* $OpenBSD: vmd.c,v 1.89 2018/07/10 20:43:15 reyk Exp $ */ /* * Copyright (c) 2015 Reyk Floeter @@ -1004,7 +1004,7 @@ vm_id2vmid(uint32_t id, struct vmd_vm *vm) { if (vm == NULL && (vm = vm_getbyid(id)) == NULL) return (0); - dprintf("%s: vmm id %u is vmid %u", __func__, + DPRINTF("%s: vmm id %u is vmid %u", __func__, id, vm->vm_vmid); return (vm->vm_vmid); } @@ -1014,7 +1014,7 @@ vm_vmid2id(uint32_t vmid, struct vmd_vm *vm) { if (vm == NULL && (vm = vm_getbyvmid(vmid)) == NULL) return (0); - dprintf("%s: vmid %u is vmm id %u", __func__, + DPRINTF("%s: vmid %u is vmm id %u", __func__, vmid, vm->vm_params.vmc_params.vcp_id); return (vm->vm_params.vmc_params.vcp_id); } diff --git a/usr.sbin/vmd/vmd.h b/usr.sbin/vmd/vmd.h index 9e5edc2c790..85a46d36d2d 100644 --- a/usr.sbin/vmd/vmd.h +++ b/usr.sbin/vmd/vmd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmd.h,v 1.71 2018/07/10 16:15:51 reyk Exp $ */ +/* $OpenBSD: vmd.h,v 1.72 2018/07/10 20:43:15 reyk Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -65,12 +65,6 @@ /* 100.64.0.0/10 from rfc6598 (IPv4 Prefix for Shared Address Space) */ #define VMD_DHCP_PREFIX "100.64.0.0/10" -#ifdef VMD_DEBUG -#define dprintf(x...) do { log_debug(x); } while(0) -#else -#define dprintf(x...) -#endif /* VMD_DEBUG */ - enum imsg_type { IMSG_VMDOP_START_VM_REQUEST = IMSG_PROC_MAX, IMSG_VMDOP_START_VM_CDROM, diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c index 918a4c545ac..90d4832c286 100644 --- a/usr.sbin/vmd/vmm.c +++ b/usr.sbin/vmd/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.82 2018/07/10 16:15:51 reyk Exp $ */ +/* $OpenBSD: vmm.c,v 1.83 2018/07/10 20:43:15 reyk Exp $ */ /* * Copyright (c) 2015 Mike Larkin @@ -479,7 +479,7 @@ vmm_dispatch_vm(int fd, short event, void *arg) if (n == 0) break; - dprintf("%s: got imsg %d from %s", + DPRINTF("%s: got imsg %d from %s", __func__, imsg.hdr.type, vm->vm_params.vmc_params.vcp_name); -- 2.20.1