[pve-devel] [RFC qemu-server 6/6] Add blacklist to cluster cpu flags

Stefan Reiter s.reiter at proxmox.com
Wed Jul 17 15:03:48 CEST 2019


Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---

Made this into a seperate commit, since I'm not entirely sure we want this - it
works just fine without it.

Reasoning for it:
The hypervisor flag is unnecessary to add by hand (and should only be in the
hosts' list in test setups anyway), the nesting flags seem pretty useless
considering nesting disables migration - which is the point of the 'cluster' CPU
type.

 PVE/QemuServer.pm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index a95ec88..2ea18a8 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3529,6 +3529,14 @@ sub query_supported_cpu_flags {
     return $flags;
 }
 
+my $cluster_cpu_blacklist = [
+    # nesting disables migrateability, 'host' type should be used if required
+    'vmx',
+    'svm',
+    # let QEMU/KVM figure out the hypervisor flag itself
+    'hypervisor'
+];
+
 sub get_cluster_cpu_options {
     # We can retrieve the understood flags locally (no cluster sync needed),
     # since they only depend on the QEMU/KVM version - and we can't migrate to
@@ -3561,6 +3569,9 @@ sub get_cluster_cpu_options {
 	# Some flags are only supported with dashes
 	(my $dashed = $_) =~ s/_/-/g;
 	'+' . $dashed;
+    } grep {
+	my $f = $_;
+	! grep { $_ eq $f } @$cluster_cpu_blacklist;
     } @$flags_intersect;
 }
 
-- 
2.20.1





More information about the pve-devel mailing list