aboutsummaryrefslogtreecommitdiff
path: root/lib/libvmmapi/vmmapi.h
diff options
context:
space:
mode:
authorRodney W. Grimes <rgrimes@FreeBSD.org>2018-04-08 19:24:49 +0000
committerRodney W. Grimes <rgrimes@FreeBSD.org>2018-04-08 19:24:49 +0000
commit01d822d33b0cd1f801ce39d0ed25fa7f57b5a429 (patch)
tree6e62af630c4d1ea3fb4b4d5e1b23dfe38ea44c9d /lib/libvmmapi/vmmapi.h
parent92223bddedf0f8b964a62904f065b12563db8ae9 (diff)
downloadsrc-01d822d33b0cd1f801ce39d0ed25fa7f57b5a429.tar.gz
src-01d822d33b0cd1f801ce39d0ed25fa7f57b5a429.zip
Add the ability to control the CPU topology of created VMs
from userland without the need to use sysctls, it allows the old sysctls to continue to function, but deprecates them at FreeBSD_version 1200060 (Relnotes for deprecate). The command line of bhyve is maintained in a backwards compatible way. The API of libvmmapi is maintained in a backwards compatible way. The sysctl's are maintained in a backwards compatible way. Added command option looks like: bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n] The optional parts can be specified in any order, but only a single integer invokes the backwards compatible parse. [,maxcpus=n] is hidden by #ifdef until kernel support is added, though the api is put in place. bhyvectl --get-cpu-topology option added. Reviewed by: grehan (maintainer, earlier version), Reviewed by: bcr (manpages) Approved by: bde (mentor), phk (mentor) Tested by: Oleg Ginzburg <olevole@olevole.ru> (cbsd) MFC after: 1 week Relnotes: Y Differential Revision: https://reviews.freebsd.org/D9930
Notes
Notes: svn path=/head/; revision=332298
Diffstat (limited to 'lib/libvmmapi/vmmapi.h')
-rw-r--r--lib/libvmmapi/vmmapi.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h
index da7267cba59d..9819cda16bd9 100644
--- a/lib/libvmmapi/vmmapi.h
+++ b/lib/libvmmapi/vmmapi.h
@@ -221,6 +221,12 @@ int vm_activate_cpu(struct vmctx *ctx, int vcpu);
int vm_suspend_cpu(struct vmctx *ctx, int vcpu);
int vm_resume_cpu(struct vmctx *ctx, int vcpu);
+/* CPU topology */
+int vm_set_topology(struct vmctx *ctx, uint16_t sockets, uint16_t cores,
+ uint16_t threads, uint16_t maxcpus);
+int vm_get_topology(struct vmctx *ctx, uint16_t *sockets, uint16_t *cores,
+ uint16_t *threads, uint16_t *maxcpus);
+
/*
* FreeBSD specific APIs
*/