From nobody Fri Nov 11 01:24:27 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4N7gwW4ftMz4f0bW; Fri, 11 Nov 2022 01:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4N7gwW3w2Yz3GB1; Fri, 11 Nov 2022 01:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668129867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBDguvOrNY3HWVXh5WrIwShAnBEt7Ami6pz1n5TT/+s=; b=qx3b6BwZ99KpaXgWyKptcNMJ3H5ZgyJxDzZF5XoGH6o/Dbhf/G9JuWwWoZKw0UJOfQ/rmt i2iFuM5IVLSqBrbwvCjLwjRh5FMf5nvacrOAGVIhVDPUDWjYpQkrEtdcDpmU8eM+AyMgwL oHMHjG1P4cdr12WxLCA6QcJ4aoQEs0VfX9Cidt72uw52a1UIOahle2FYj7w7EY+sP3mcld vxUEqrSabhSp203PyRQH/Y1/MNxrS/8AoQDp6NFgNnEZ67zdTXZ9U0AxkqNi5kAgHJWb9y fixVAKZ+uT+WM+KLzu8BpVwI01mJbE0tKmxVT2IukVC27TrMIy3TSJaJiXPN1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668129867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=oBDguvOrNY3HWVXh5WrIwShAnBEt7Ami6pz1n5TT/+s=; b=lyqcihU+IzlfhP0KDu6092F+HZ1AbsNGreYx9bCwsMzWbeVQKQw7MfKOzuTCHbRhdFw+9T vaZQRNvLAdzSxQEvXn6gGYO4bPatVaohggAnKxDtMlcE/B2P+2Ce+ogJqbWhJXym+HqB6X m2Zf75/TP91QAkVuPfDVeXLZ1PZFk9uhMQ93fLidGOtVlsT4kaUWrPEqBVyuh7wiFH2Jpf Gr+HxLSnTMaTa1i3j2zxySD/WhSe2Fs7kZI1vHetDRiyXTSjEgoO8x0xlKdHlTlZrPFKL0 +tZNJLat9UJqfaOhFMR++Ju2QzUyAjwsPvq1e57AUHEiKviiTKYqsI01QkxJTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668129867; a=rsa-sha256; cv=none; b=DcFcWLJRY0+yOQuVBypQC/jXnm08oGOQih0AwBRhHEwHliIJPGfgyUHmjnvwU6eW01snDU dM6zTA91vQ42Zt0e3BU5674sniRz32pwZo0OJtK2AuTdjdVsnbQrnfKN3JpRVve7rSVne8 Rop70WqaWHYqteHwyAB2Ar26ghYIJnULAXikGURpYQ1YRPSUKumJgyhTzugWhSdxt22mcu dP39+tr7H34pDIykFYPu/EciKMRGDpA5vT7zFTZfIt0E6wWAsqyrXr2hyeMhQYodqoUf0d v4Topj1De1mRibxApPoY0L15Xfas2t/C5+NL97EbJBJVReFr1dNS8YgDW10ZVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4N7gwW3276zNg5; Fri, 11 Nov 2022 01:24:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AB1OR6b027160; Fri, 11 Nov 2022 01:24:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AB1ORTn027159; Fri, 11 Nov 2022 01:24:27 GMT (envelope-from git) Date: Fri, 11 Nov 2022 01:24:27 GMT Message-Id: <202211110124.2AB1ORTn027159@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 597a39a77132 - stable/13 - bhyve virtio-scsi: Tidy warning and debug prints. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 597a39a771325235863b1319479b0eb403bf9a26 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=597a39a771325235863b1319479b0eb403bf9a26 commit 597a39a771325235863b1319479b0eb403bf9a26 Author: John Baldwin AuthorDate: 2022-08-29 22:35:42 +0000 Commit: John Baldwin CommitDate: 2022-11-11 01:10:10 +0000 bhyve virtio-scsi: Tidy warning and debug prints. Use a consistent prefix ("virtio-scsi: ") similar to the e1000 device model. Reviewed by: mav, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D36270 (cherry picked from commit 62806a7f31e3b4813c4e6b70534c41f91bfe4e12) --- usr.sbin/bhyve/pci_virtio_scsi.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/usr.sbin/bhyve/pci_virtio_scsi.c b/usr.sbin/bhyve/pci_virtio_scsi.c index a1cf6e246182..a960afd21317 100644 --- a/usr.sbin/bhyve/pci_virtio_scsi.c +++ b/usr.sbin/bhyve/pci_virtio_scsi.c @@ -88,8 +88,8 @@ __FBSDID("$FreeBSD$"); #define VIRTIO_SCSI_F_CHANGE (1 << 2) static int pci_vtscsi_debug = 0; -#define DPRINTF(params) if (pci_vtscsi_debug) PRINTLN params -#define WPRINTF(params) PRINTLN params +#define WPRINTF(msg, params...) PRINTLN("virtio-scsi: " msg, ##params) +#define DPRINTF(msg, params...) if (pci_vtscsi_debug) WPRINTF(msg, ##params) struct pci_vtscsi_config { uint32_t num_queues; @@ -289,8 +289,7 @@ pci_vtscsi_proc(void *arg) vq_endchains(q->vsq_vq, 0); pthread_mutex_unlock(&q->vsq_qmtx); - DPRINTF(("virtio-scsi: request completed", - req->vsr_idx)); + DPRINTF("request completed", req->vsr_idx); free(req); } @@ -305,7 +304,7 @@ pci_vtscsi_reset(void *vsc) sc = vsc; - DPRINTF(("vtscsi: device reset requested")); + DPRINTF("device reset requested"); vi_reset_dev(&sc->vss_vs); /* initialize config structure */ @@ -434,13 +433,13 @@ pci_vtscsi_tmf_handle(struct pci_vtscsi_softc *sc, struct sbuf *sb = sbuf_new_auto(); ctl_io_sbuf(io, sb); sbuf_finish(sb); - DPRINTF(("pci_virtio_scsi: %s", sbuf_data(sb))); + DPRINTF("%s", sbuf_data(sb)); sbuf_delete(sb); } err = ioctl(sc->vss_ctl_fd, CTL_IO, io); if (err != 0) - WPRINTF(("CTL_IO: err=%d (%s)", errno, strerror(errno))); + WPRINTF("CTL_IO: err=%d (%s)", errno, strerror(errno)); tmf->response = io->taskio.task_status; ctl_scsi_free_io(io); @@ -527,13 +526,13 @@ pci_vtscsi_request_handle(struct pci_vtscsi_queue *q, struct iovec *iov_in, struct sbuf *sb = sbuf_new_auto(); ctl_io_sbuf(io, sb); sbuf_finish(sb); - DPRINTF(("pci_virtio_scsi: %s", sbuf_data(sb))); + DPRINTF("%s", sbuf_data(sb)); sbuf_delete(sb); } err = ioctl(sc->vss_ctl_fd, CTL_IO, io); if (err != 0) { - WPRINTF(("CTL_IO: err=%d (%s)", errno, strerror(errno))); + WPRINTF("CTL_IO: err=%d (%s)", errno, strerror(errno)); cmd_wr->response = VIRTIO_SCSI_S_FAILURE; } else { cmd_wr->sense_len = MIN(io->scsiio.sense_len, @@ -622,8 +621,7 @@ pci_vtscsi_requestq_notify(void *vsc, struct vqueue_info *vq) pthread_cond_signal(&q->vsq_cv); pthread_mutex_unlock(&q->vsq_mtx); - DPRINTF(("virtio-scsi: request enqueued", - vireq.idx)); + DPRINTF("request enqueued", vireq.idx); } } @@ -695,7 +693,7 @@ pci_vtscsi_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) devname = "/dev/cam/ctl"; sc->vss_ctl_fd = open(devname, O_RDWR); if (sc->vss_ctl_fd < 0) { - WPRINTF(("cannot open %s: %s", devname, strerror(errno))); + WPRINTF("cannot open %s: %s", devname, strerror(errno)); free(sc); return (1); }