Page MenuHomeFreeBSD

D34493.diff
No OneTemporary

D34493.diff

diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -1001,16 +1001,20 @@
static int
num_vcpus_allowed(struct vmctx *ctx)
{
+ uint16_t sockets, cores, threads, maxcpus;
int tmp, error;
- error = vm_get_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, &tmp);
-
/*
* The guest is allowed to spinup more than one processor only if the
* UNRESTRICTED_GUEST capability is available.
*/
+ error = vm_get_capability(ctx, BSP, VM_CAP_UNRESTRICTED_GUEST, &tmp);
+ if (error != 0)
+ return (1);
+
+ error = vm_get_topology(ctx, &sockets, &cores, &threads, &maxcpus);
if (error == 0)
- return (VM_MAXCPU);
+ return (maxcpus);
else
return (1);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 20, 7:33 AM (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14733119
Default Alt Text
D34493.diff (744 B)

Event Timeline