diff --git a/PVE/QemuServer/CPUConfig.pm b/PVE/QemuServer/CPUConfig.pm index 758a1d4b..939de8e5 100644 --- a/PVE/QemuServer/CPUConfig.pm +++ b/PVE/QemuServer/CPUConfig.pm @@ -29,6 +29,12 @@ sub load_custom_model_conf { return cfs_read_file($default_filename); } +my $depreacated_cpu_map = { + # there never was such a client CPU, so map it to the server one for backward compat + 'Icelake-Client' => 'Icelake-Server', + 'Icelake-Client-noTSX' => 'Icelake-Server-noTSX', +}; + my $cpu_vendor_list = { # Intel CPUs 486 => 'GenuineIntel', @@ -64,8 +70,8 @@ my $cpu_vendor_list = { 'Cascadelake-Server' => 'GenuineIntel', 'Cascadelake-Server-noTSX' => 'GenuineIntel', KnightsMill => 'GenuineIntel', - 'Icelake-Client' => 'GenuineIntel', - 'Icelake-Client-noTSX' => 'GenuineIntel', + 'Icelake-Client' => 'GenuineIntel', # depreacated, removed with QEMU 7.1 + 'Icelake-Client-noTSX' => 'GenuineIntel', # depreacated, removed with QEMU 7.1 'Icelake-Server' => 'GenuineIntel', 'Icelake-Server-noTSX' => 'GenuineIntel', @@ -358,6 +364,8 @@ sub print_cpu_device { my $custom_cpu = get_custom_model($cpu); $cpu = $custom_cpu->{'reported-model'} // $cpu_fmt->{'reported-model'}->{default}; + } elsif (my $replacement_type = $depreacated_cpu_map->{$cpu}) { + $cpu = $replacement_type; } } @@ -475,6 +483,10 @@ sub get_cpu_options { $hv_vendor_id = $custom_cpu->{'hv-vendor-id'}; } + if (my $replacement_type = $depreacated_cpu_map->{$cputype}) { + $cputype = $replacement_type; + } + # 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'}); diff --git a/test/cfg2cmd/cputype-icelake-client-deprecation.conf b/test/cfg2cmd/cputype-icelake-client-deprecation.conf new file mode 100644 index 00000000..668a3237 --- /dev/null +++ b/test/cfg2cmd/cputype-icelake-client-deprecation.conf @@ -0,0 +1,15 @@ +# TEST: test CPU type depreacation for Icelake-Client (never existed in the wild) +# QEMU_VERSION: 7.1 +bootdisk: scsi0 +cores: 2 +cpu: Icelake-Client +ide2: none,media=cdrom +memory: 768 +name: simple +net0: virtio=A2:C0:43:77:08:A0,bridge=vmbr0 +ostype: l26 +scsi0: local:8006/base-8006-disk-0.qcow2,discard=on,size=104858K +scsihw: virtio-scsi-pci +smbios1: uuid=7b10d7af-b932-4c66-b2c3-3996152ec465 +sockets: 1 +vmgenid: c773c261-d800-4348-9f5d-167fadd53cf8 diff --git a/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd b/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd new file mode 100644 index 00000000..9960e5ee --- /dev/null +++ b/test/cfg2cmd/cputype-icelake-client-deprecation.conf.cmd @@ -0,0 +1,33 @@ +/usr/bin/kvm \ + -id 8006 \ + -name 'simple,debug-threads=on' \ + -no-shutdown \ + -chardev 'socket,id=qmp,path=/var/run/qemu-server/8006.qmp,server=on,wait=off' \ + -mon 'chardev=qmp,mode=control' \ + -chardev 'socket,id=qmp-event,path=/var/run/qmeventd.sock,reconnect=5' \ + -mon 'chardev=qmp-event,mode=control' \ + -pidfile /var/run/qemu-server/8006.pid \ + -daemonize \ + -smbios 'type=1,uuid=7b10d7af-b932-4c66-b2c3-3996152ec465' \ + -smp '2,sockets=1,cores=2,maxcpus=2' \ + -nodefaults \ + -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' \ + -vnc 'unix:/var/run/qemu-server/8006.vnc,password=on' \ + -cpu 'Icelake-Server,enforce,+kvm_pv_eoi,+kvm_pv_unhalt,vendor=GenuineIntel' \ + -m 768 \ + -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' \ + -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' \ + -device 'vmgenid,guid=c773c261-d800-4348-9f5d-167fadd53cf8' \ + -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' \ + -device 'usb-tablet,id=tablet,bus=uhci.0,port=1' \ + -device 'VGA,id=vga,bus=pci.0,addr=0x2' \ + -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3,free-page-reporting=on' \ + -iscsi 'initiator-name=iqn.1993-08.org.debian:01:aabbccddeeff' \ + -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \ + -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=200' \ + -device 'virtio-scsi-pci,id=scsihw0,bus=pci.0,addr=0x5' \ + -drive 'file=/var/lib/vz/images/8006/base-8006-disk-0.qcow2,if=none,id=drive-scsi0,discard=on,format=qcow2,cache=none,aio=io_uring,detect-zeroes=unmap' \ + -device 'scsi-hd,bus=scsihw0.0,channel=0,scsi-id=0,lun=0,drive=drive-scsi0,id=scsi0,bootindex=100' \ + -netdev 'type=tap,id=net0,ifname=tap8006i0,script=/var/lib/qemu-server/pve-bridge,downscript=/var/lib/qemu-server/pve-bridgedown,vhost=on' \ + -device 'virtio-net-pci,mac=A2:C0:43:77:08:A0,netdev=net0,bus=pci.0,addr=0x12,id=net0,bootindex=300' \ + -machine 'type=pc+pve0'