aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-02-16 14:56:39 +0000
committerMark Johnston <markj@FreeBSD.org>2026-02-16 15:28:49 +0000
commit7ab5e3f29a50bc9294a139cc0e8e661a7c036ba3 (patch)
treecf7102e20d5cd5615e3bfd18e2891a8d98733e80
parentc71354030a26900e564f0c80a8abdff7e77b3c9e (diff)
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
-rw-r--r--usr.sbin/bhyve/pci_passthru.c9
1 files 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;
}