Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102966820
D34493.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
744 B
Referenced Files
None
Subscribers
None
D34493.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
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)
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