vmm: Add CPU affinity support

With the introduction of a new option `affinity` to the `cpus`
parameter, Cloud Hypervisor can now let the user choose the set
of host CPUs where to run each vCPU.

This is useful when trying to achieve CPU pinning, as well as making
sure the VM runs on a specific NUMA node.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-11-10 10:43:52 +01:00
committed by Rob Bradford
parent a4f5ad6076
commit 932c8c9713
5 changed files with 85 additions and 4 deletions

View File

@@ -480,6 +480,16 @@ components:
default: false
description: Virtual machine configuration
CpuAffinity:
type: object
properties:
vcpu:
type: integer
host_cpus:
type: array
items:
type: integer
CpuTopology:
type: object
properties:
@@ -507,9 +517,13 @@ components:
default: 1
type: integer
topology:
$ref: '#/components/schemas/CpuTopology'
$ref: '#/components/schemas/CpuTopology'
max_phys_bits:
type: integer
affinity:
type: array
items:
$ref: '#/components/schemas/CpuAffinity'
MemoryZoneConfig:
required: