Please refer to ``cam(4)``, ``ctl(4)``, and ``ctld(8)`` manual pages
for more details on CAM and CTL.
+vCPU pinning
+~~~~~~~~~~~~
+
+:since:`Since 12.1.0`, it is possible to pin domain vCPUs
+to the specific host CPUs.
+
+Example:
+
+::
+
+ <domain type='bhyve'>
+ ...
+ <vcpu>2</vcpu>
+ <cputune>
+ <vcpupin vcpu="0" cpuset="1-4,^2"/>
+ <vcpupin vcpu="1" cpuset="0,4"/>
+ </cputune>
+ ...
+ </domain>
+
Guest-specific considerations
-----------------------------
virCommandAddArgFormat(cmd, "%d", nvcpus);
}
+ /* CPU tuning */
+ for (i = 0; i < virDomainDefGetVcpusMax(def); i++) {
+ virDomainVcpuDef *vcpu = virDomainDefGetVcpu(def, i);
+
+ if (vcpu->cpumask) {
+ ssize_t j = -1;
+
+ while ((j = virBitmapNextSetBit(vcpu->cpumask, j)) >= 0) {
+ virCommandAddArg(cmd, "-p");
+ virCommandAddArgFormat(cmd, "%zu:%zu", i, j);
+ }
+
+ }
+ }
+
/* Memory */
virCommandAddArg(cmd, "-m");
virCommandAddArgFormat(cmd, "%llu",
--- /dev/null
+bhyve \
+-c 2 \
+-p 0:1 \
+-p 0:3 \
+-p 0:4 \
+-p 1:0 \
+-p 1:4 \
+-m 214 \
+-u \
+-H \
+-P \
+-s 0:0,hostbridge \
+-s 2:0,ahci,hd:/tmp/freebsd.img \
+-s 3:0,virtio-net,faketapdev,mac=52:54:00:b9:94:02 \
+bhyve
--- /dev/null
+bhyveload \
+-m 214 \
+-d /tmp/freebsd.img \
+bhyve
--- /dev/null
+<domain type='bhyve'>
+ <name>bhyve</name>
+ <uuid>df3be7e7-a104-11e3-aeb0-50e5492bd3dc</uuid>
+ <memory>219136</memory>
+ <vcpu>2</vcpu>
+ <cputune>
+ <vcpupin vcpu="0" cpuset="1-4,^2"/>
+ <vcpupin vcpu="1" cpuset="0,4"/>
+ </cputune>
+ <os>
+ <type>hvm</type>
+ </os>
+ <devices>
+ <disk type='file'>
+ <driver name='file' type='raw'/>
+ <source file='/tmp/freebsd.img'/>
+ <target dev='hda' bus='sata'/>
+ <address type='drive' controller='0' bus='0' target='2' unit='0'/>
+ </disk>
+ <interface type='bridge'>
+ <mac address='52:54:00:b9:94:02'/>
+ <model type='virtio'/>
+ <source bridge="virbr0"/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
+ </interface>
+ </devices>
+</domain>
DO_TEST("slirp-mac-addr");
DO_TEST_FAILURE("slirp-ip");
DO_TEST("virtio-scsi");
+ DO_TEST("vcpupin");
/* Address allocation tests */
DO_TEST("addr-single-sata-disk");