[pve-devel] [PATCH qemu-server] add 'flags' property to cpu option

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Jan 9 15:30:14 CET 2018


Currently this only allows specifying '+pcid' or '-pcid'
but might be extended in the future.

Signed-off-by: Wolfgang Bumiller <w.bumiller at proxmox.com>
---
 PVE/QemuServer.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 32bf70d..3e3c93e 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -150,6 +150,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 = {
@@ -3143,6 +3153,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';
-- 
2.11.0





More information about the pve-devel mailing list