Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144540290
D34493.1775304138.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
744 B
Referenced Files
None
Subscribers
None
D34493.1775304138.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 4, 12:02 PM (2 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28259156
Default Alt Text
D34493.1775304138.diff (744 B)
Attached To
Mode
D34493: bhyve: Use vm_get_topology to query kernel's maximum vCPU count.
Attached
Detach File
Event Timeline
Log In to Comment