]> git.proxmox.com Git - qemu-server.git/commitdiff
cpu config: minor code style nits/comment
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Aug 2022 07:01:40 +0000 (09:01 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 30 Aug 2022 07:09:13 +0000 (09:09 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/QemuServer/CPUConfig.pm

index 48b555a914f83a85b9080c6ee8c3fb0923bf135c..758a1d4b91d7bf24f0e4ecb9514105f55e1e69b4 100644 (file)
@@ -357,8 +357,7 @@ sub print_cpu_device {
        if (is_custom_model($cpu)) {
            my $custom_cpu = get_custom_model($cpu);
 
-           $cpu = $custom_cpu->{'reported-model'} //
-               $cpu_fmt->{'reported-model'}->{default};
+           $cpu = $custom_cpu->{'reported-model'} // $cpu_fmt->{'reported-model'}->{default};
        }
     }
 
@@ -367,6 +366,7 @@ sub print_cpu_device {
     my $current_core = ($id - 1) % $cores;
     my $current_socket = int(($id - 1 - $current_core)/$cores);
 
+    # FIXME: hot plugging other architectures like our unofficial arch64 support?
     return "$cpu-x86_64-cpu,id=cpu$id,socket-id=$current_socket,core-id=$current_core,thread-id=0";
 }
 
@@ -470,18 +470,14 @@ sub get_cpu_options {
        if (is_custom_model($cputype)) {
            $custom_cpu = get_custom_model($cputype);
 
-           $cputype = $custom_cpu->{'reported-model'} //
-               $cpu_fmt->{'reported-model'}->{default};
-           $kvm_off = $custom_cpu->{hidden}
-               if defined($custom_cpu->{hidden});
+           $cputype = $custom_cpu->{'reported-model'} // $cpu_fmt->{'reported-model'}->{default};
+           $kvm_off = $custom_cpu->{hidden} if defined($custom_cpu->{hidden});
            $hv_vendor_id = $custom_cpu->{'hv-vendor-id'};
        }
 
        # VM-specific settings override custom CPU config
-       $kvm_off = $cpu->{hidden}
-           if defined($cpu->{hidden});
-       $hv_vendor_id = $cpu->{'hv-vendor-id'}
-           if defined($cpu->{'hv-vendor-id'});
+       $kvm_off = $cpu->{hidden} if defined($cpu->{hidden});
+       $hv_vendor_id = $cpu->{'hv-vendor-id'} if defined($cpu->{'hv-vendor-id'});
     }
 
     my $pve_flags = get_pve_cpu_flags($conf, $kvm, $cputype, $arch, $machine_version);