|
| 1 | +diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm |
| 2 | +index e1dc3e7e..d21fb6ed 100644 |
| 3 | +--- a/PVE/API2/Qemu.pm |
| 4 | ++++ b/PVE/API2/Qemu.pm |
| 5 | +@@ -684,6 +684,7 @@ my $generaloptions = { |
| 6 | + 'name' => 1, |
| 7 | + 'onboot' => 1, |
| 8 | + 'ostype' => 1, |
| 9 | ++ 'gicversion' =>1, |
| 10 | + 'protection' => 1, |
| 11 | + 'reboot' => 1, |
| 12 | + 'startdate' => 1, |
| 13 | +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm |
| 14 | +index 6f0d41fc..d351dfbc 100644 |
| 15 | +--- a/PVE/QemuServer.pm |
| 16 | ++++ b/PVE/QemuServer.pm |
| 17 | +@@ -420,6 +420,12 @@ my $confdesc = { |
| 18 | + type => 'string', |
| 19 | + description => "Memory properties.", |
| 20 | + format => $PVE::QemuServer::Memory::memory_fmt |
| 21 | ++ }, |
| 22 | ++ gicversion => { |
| 23 | ++ optional => 1, |
| 24 | ++ type => 'string', |
| 25 | ++ description => "Set virt gic-version", |
| 26 | ++ enum => [qw(host 2 3 4 max)], |
| 27 | + }, |
| 28 | + 'amd-sev' => { |
| 29 | + description => "Secure Encrypted Virtualization (SEV) features by AMD CPUs", |
| 30 | +@@ -4279,14 +4285,17 @@ sub config_to_command { |
| 31 | + my $machine_type_min = $machine_type; |
| 32 | + $machine_type_min =~ s/\+pve\d+$//; |
| 33 | + $machine_type_min .= "+pve$required_pve_version"; |
| 34 | ++ |
| 35 | ++ |
| 36 | ++ my $gicv = $kvm ? 'host' : 'max'; |
| 37 | ++ if ( $conf->{gicversion} ) { |
| 38 | ++ $gicv = $conf->{gicversion}; |
| 39 | ++ } |
| 40 | ++ |
| 41 | + if ($arch eq 'aarch64'){ |
| 42 | +- if (!$kvm){ |
| 43 | +- push @$machineFlags, "type=${machine_type_min}"; |
| 44 | +- }else{ |
| 45 | +- push @$machineFlags, "type=${machine_type_min},gic-version=host"; |
| 46 | +- } |
| 47 | ++ push @$machineFlags, "type=${machine_type_min},gic-version=${gicv}"; |
| 48 | + }else{ |
| 49 | +- push @$machineFlags, "type=${machine_type_min}"; |
| 50 | ++ push @$machineFlags, "type=${machine_type_min}"; |
| 51 | + } |
| 52 | + |
| 53 | + # This method is prevented from being executed on the Port branch. |
0 commit comments