From 484262894fa718bffb528bcfd58e25163e001776 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 9 Jan 2018 15:30:14 +0100 Subject: [PATCH] add 'flags' property to cpu option Currently this only allows specifying '+pcid' or '-pcid' but might be extended in the future. Signed-off-by: Wolfgang Bumiller (cherry picked from commit 39fd79e2ad17e2e73bcf93d795413b7365f2a5e2) --- PVE/QemuServer.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index b1ff5241..2961eede 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -151,6 +151,16 @@ my $cpu_fmt = { optional => 1, default => 0 }, + flags => { + description => "Override CPU flags. Currently only the 'pcid' flag is supported." + . " Use '+pcid' or '-pcid' to enable or disable." + . " This takes precedence over flags coming from the cpu type or changed implicitly via the OS type.", + format_description => 'flaglist', + type => 'string', + pattern => '[+-]pcid', + optional => 1, + default => '', + }, }; my $watchdog_fmt = { @@ -3081,6 +3091,10 @@ sub config_to_command { or die "Cannot parse cpu description: $cputype\n"; $cpu = $cpuconf->{cputype}; $kvm_off = 1 if $cpuconf->{hidden}; + + if (defined(my $flags = $cpuconf->{flags})) { + push @$cpuFlags, $flags; + } } push @$cpuFlags , '+lahf_lm' if $cpu eq 'kvm64';