From 27537022c5a4f3ae764c95e37a3700a65ef854a4 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 9 Mar 2022 15:39:16 -0800 Subject: [PATCH] bhyve: Don't force an upper bound on vCPUs when parsing pinning. Even today it is possible to specify pinning for a vCPU higher than the configured number of CPUs but lower than VM_MAXCPU without raising an error. Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D34492 (cherry picked from commit fd6f92946f02b451c792bfdbc94259ff65e49969) --- usr.sbin/bhyve/bhyverun.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 43032b9f78f..3a474fcdf27 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -392,9 +392,8 @@ pincpu_parse(const char *opt) return (-1); } - if (vcpu < 0 || vcpu >= VM_MAXCPU) { - fprintf(stderr, "vcpu '%d' outside valid range from 0 to %d\n", - vcpu, VM_MAXCPU - 1); + if (vcpu < 0) { + fprintf(stderr, "invalid vcpu '%d'\n", vcpu); return (-1); } -- 2.45.0