Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions PVE/QemuServer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,15 @@ EODESCR
description => "Configure a VirtIO-based Random Number Generator.",
optional => 1,
},
cpu_taskset => {
optional => 1,
type => 'string',
description => "CPU pinning config.",
verbose_description => "When specified VM will be launched with `cpuset -c {cpu_taskset} kvm ...`\n"
."No argument test is performed so please make sure the value matches VM cpu total thread count.\n"
."This is required when VM is sensitive to host context switching (e.g. gaming),"
." or when host is not SMP so VM thread could be switched to a different CPU architecture (e.g. big.LITTLE for ARM).",
},
};

my $cicustom_fmt = {
Expand Down Expand Up @@ -3219,6 +3228,10 @@ sub config_to_command {
my $cpuunits = defined($conf->{cpuunits}) ?
$conf->{cpuunits} : $defaults->{cpuunits};

if (defined($conf->{cpu_taskset})) {
push @$cmd, 'taskset', '-c', $conf->{cpu_taskset};
}

push @$cmd, $kvm_binary;

push @$cmd, '-id', $vmid;
Expand Down