]> git.proxmox.com Git - qemu-server.git/commitdiff
add 'flags' property to cpu option
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 9 Jan 2018 14:30:14 +0000 (15:30 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 9 Jan 2018 14:42:53 +0000 (15:42 +0100)
Currently this only allows specifying '+pcid' or '-pcid'
but might be extended in the future.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
PVE/QemuServer.pm

index 32bf70d3b9e8f8cda911fd9c3384769a357d9e02..3e3c93e2b4f236a81dd0e16f488ebbd3a41be9e7 100644 (file)
@@ -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';