Группа :: Система/Серверы
Пакет: pve-manager
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: qemu-server-aarch64.patch
Скачать
Скачать
--- qemu-server/PVE/API2/Qemu.pm.aarch64 2020-05-08 14:00:26.000000000 +0300
+++ qemu-server/PVE/API2/Qemu.pm 2020-10-09 11:15:10.050904537 +0300
@@ -55,7 +55,7 @@ my $resolve_cdrom_alias = sub {
if (my $value = $param->{cdrom}) {
$value .= ",media=cdrom" if $value !~ m/media=/;
- $param->{ide2} = $value;
+ $param->{scsi7} = $value;
delete $param->{cdrom};
}
};
@@ -1068,7 +1068,7 @@ my $update_vm_api = sub {
my @delete = ();
foreach my $opt (PVE::Tools::split_list($delete_str)) {
- $opt = 'ide2' if $opt eq 'cdrom';
+ $opt = 'scsi7' if $opt eq 'cdrom';
raise_param_exc({ delete => "you can't use '-$opt' and " .
"-delete $opt' at the same time" })
--- qemu-server/PVE/QemuServer.pm.aarch64 2020-05-08 14:00:26.000000000 +0300
+++ qemu-server/PVE/QemuServer.pm 2020-10-09 12:19:39.728167914 +0300
@@ -561,7 +561,7 @@ EODESCR
optional => 1,
type => 'string', format => 'pve-qm-ide',
typetext => '<volume>',
- description => "This is an alias for option -ide2",
+ description => "This is an alias for option -scsi7",
},
cpu => {
optional => 1,
@@ -2155,7 +2155,7 @@ sub parse_vm_config {
if ($@) {
warn "vm $vmid - unable to parse value of '$key' - $@";
} else {
- $key = 'ide2' if $key eq 'cdrom';
+ $key = 'scsi7' if $key eq 'cdrom';
my $fmt = $confdesc->{$key}->{format};
if ($fmt && $fmt =~ /^pve-qm-(?:ide|scsi|virtio|sata)$/) {
my $v = parse_drive($key, $value);
@@ -2188,8 +2188,8 @@ sub write_vm_config {
delete $conf->{snapstate}; # just to be sure
if ($conf->{cdrom}) {
- die "option ide2 conflicts with cdrom\n" if $conf->{ide2};
- $conf->{ide2} = $conf->{cdrom};
+ die "option scsi7 conflicts with cdrom\n" if $conf->{scsi7};
+ $conf->{scsi7} = $conf->{cdrom};
delete $conf->{cdrom};
}
@@ -2841,7 +2841,7 @@ my $Arch2Qemu = {
};
sub get_command_for_arch($) {
my ($arch) = @_;
- return '/usr/bin/kvm' if is_native($arch);
+# return '/usr/bin/kvm' if is_native($arch);
my $cmd = $Arch2Qemu->{$arch}
or die "don't know how to emulate architecture '$arch'\n";
@@ -3602,7 +3602,9 @@ sub config_to_command {
}
}
- if (!$kvm) {
+ if ($kvm && is_native($arch)) {
+ push @$machineFlags, 'accel=kvm';
+ } else {
push @$machineFlags, 'accel=tcg';
}
@@ -3613,6 +3615,10 @@ sub config_to_command {
}
push @$machineFlags, "type=${machine_type_min}";
+ if ($arch eq 'aarch64' && $kvm) {
+ push @$machineFlags, "gic-version=host";
+ }
+
push @$cmd, @$devices;
push @$cmd, '-rtc', join(',', @$rtcFlags) if scalar(@$rtcFlags);
push @$cmd, '-machine', join(',', @$machineFlags) if scalar(@$machineFlags);
--- qemu-server/PVE/QemuServer/CPUConfig.pm.aarch64 2020-05-08 14:00:26.000000000 +0300
+++ qemu-server/PVE/QemuServer/CPUConfig.pm 2020-10-09 11:15:10.051904540 +0300
@@ -464,7 +464,11 @@ sub get_cpu_options {
my $cputype = $kvm ? "kvm64" : "qemu64";
if ($arch eq 'aarch64') {
- $cputype = 'cortex-a57';
+ if (!$kvm) {
+ $cputype = 'cortex-a57';
+ } else {
+ $cputype = 'host';
+ }
}
my $cpu = {};