git: 7ab5e3f29a50 - main - bhyve: Fix a misleading error message

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 16 Feb 2026 15:29:12 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=7ab5e3f29a50bc9294a139cc0e8e661a7c036ba3

commit 7ab5e3f29a50bc9294a139cc0e8e661a7c036ba3
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-02-16 14:56:39 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-02-16 15:28:49 +0000

    bhyve: Fix a misleading error message
    
    The ioctl might fail because it's run in a jail which doesn't have
    permission to invoke ppt ioctls.
    
    Reviewed by:    jhb
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Sponsored by:   Klara, Inc.
    Differential Revision:  https://reviews.freebsd.org/D55070
---
 usr.sbin/bhyve/pci_passthru.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c
index 662390413dbc..e38dc327fdff 100644
--- a/usr.sbin/bhyve/pci_passthru.c
+++ b/usr.sbin/bhyve/pci_passthru.c
@@ -987,8 +987,13 @@ passthru_init(struct pci_devinst *pi, nvlist_t *nvl)
 	}
 
 	if (vm_assign_pptdev(pi->pi_vmctx, bus, slot, func) != 0) {
-		warnx("PCI device at %d/%d/%d is not using the ppt(4) driver",
-		    bus, slot, func);
+		if (errno == ENOENT) {
+			EPRINTLN(
+		    "PCI device at %d/%d/%d is not using the ppt driver",
+			    bus, slot, func);
+		} else {
+			EPRINTLN("vm_assign_pptdev: %s", strerror(errno));
+		}
 		goto done;
 	}