cpu config: code format/whitespace fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-03-16 15:53:00 +01:00
parent 1770b70fdf
commit 11f9264fed

View File

@ -140,11 +140,10 @@ my $cpu_fmt = {
optional => 1, optional => 1,
}, },
flags => { flags => {
description => "List of additional CPU flags separated by ';'." description => "List of additional CPU flags separated by ';'. Use '+FLAG' to enable,"
. " Use '+FLAG' to enable, '-FLAG' to disable a flag." ." '-FLAG' to disable a flag. Custom CPU models can specify any flag supported by"
. " Custom CPU models can specify any flag supported by" ." QEMU/KVM, VM-specific flags must be from the following set for security reasons: "
. " QEMU/KVM, VM-specific flags must be from the following" . join(', ', @supported_cpu_flags),
. " set for security reasons: @{[join(', ', @supported_cpu_flags)]}.",
format_description => '+FLAG[;-FLAG...]', format_description => '+FLAG[;-FLAG...]',
type => 'string', type => 'string',
pattern => qr/$cpu_flag_any_re(;$cpu_flag_any_re)*/, pattern => qr/$cpu_flag_any_re(;$cpu_flag_any_re)*/,
@ -154,10 +153,9 @@ my $cpu_fmt = {
type => 'string', type => 'string',
format => 'pve-phys-bits', format => 'pve-phys-bits',
format_description => '8-64|host', format_description => '8-64|host',
description => "The physical memory address bits that are reported to" description => "The physical memory address bits that are reported to the guest OS. Should"
. " the guest OS. Should be smaller or equal to the host's." ." be smaller or equal to the host's. Set to 'host' to use value from host CPU, but"
. " Set to 'host' to use value from host CPU, but note that" ." note that doing so will break live migration to CPUs with other values.",
. " doing so will break live migration to CPUs with other values.",
optional => 1, optional => 1,
}, },
}; };
@ -497,11 +495,11 @@ sub get_cpu_options {
) )
: undef; : undef;
my $custom_cputype_flags = parse_cpuflag_list($cpu_flag_any_re, my $custom_cputype_flags = parse_cpuflag_list(
"set by custom CPU model", $custom_cpu->{flags}); $cpu_flag_any_re, "set by custom CPU model", $custom_cpu->{flags});
my $vm_flags = parse_cpuflag_list($cpu_flag_supported_re, my $vm_flags = parse_cpuflag_list(
"manually set for VM", $cpu->{flags}); $cpu_flag_supported_re, "manually set for VM", $cpu->{flags});
my $pve_forced_flags = {}; my $pve_forced_flags = {};
$pve_forced_flags->{'enforce'} = { $pve_forced_flags->{'enforce'} = {
@ -526,8 +524,8 @@ sub get_cpu_options {
my $cpu_str = $cputype; my $cpu_str = $cputype;
# will be resolved in parameter order # will be resolved in parameter order
$cpu_str .= resolve_cpu_flags($pve_flags, $hv_flags, $custom_cputype_flags, $cpu_str .= resolve_cpu_flags(
$vm_flags, $pve_forced_flags); $pve_flags, $hv_flags, $custom_cputype_flags, $vm_flags, $pve_forced_flags);
my $phys_bits = ''; my $phys_bits = '';
foreach my $conf ($custom_cpu, $cpu) { foreach my $conf ($custom_cpu, $cpu) {