|
| 1 | +diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm |
| 2 | +index 7110378e..30489608 100644 |
| 3 | +--- a/PVE/API2/Qemu.pm |
| 4 | ++++ b/PVE/API2/Qemu.pm |
| 5 | +@@ -17,7 +17,7 @@ use PVE::CGroup; |
| 6 | + use PVE::Cluster qw (cfs_read_file cfs_write_file);; |
| 7 | + use PVE::RRD; |
| 8 | + use PVE::SafeSyslog; |
| 9 | +-use PVE::Tools qw(extract_param); |
| 10 | ++use PVE::Tools qw(extract_param get_host_arch); |
| 11 | + use PVE::Exception qw(raise raise_param_exc raise_perm_exc); |
| 12 | + use PVE::Storage; |
| 13 | + use PVE::JSONSchema qw(get_standard_option); |
| 14 | +@@ -675,6 +675,7 @@ my $hwtypeoptions = { |
| 15 | + |
| 16 | + my $generaloptions = { |
| 17 | + 'agent' => 1, |
| 18 | ++ 'arch' => 1, |
| 19 | + 'autostart' => 1, |
| 20 | + 'bios' => 1, |
| 21 | + 'description' => 1, |
| 22 | +@@ -1225,10 +1226,10 @@ __PACKAGE__->register_method({ |
| 23 | + ); |
| 24 | + $conf->{$_} = $created_opts->{$_} for keys $created_opts->%*; |
| 25 | + |
| 26 | +- # set default bios to ovmf |
| 27 | +- if (!$conf->{bios}){ |
| 28 | +- $conf->{bios} = 'ovmf'; |
| 29 | +- } |
| 30 | ++ # set default bios to ovmf |
| 31 | ++ if (!$conf->{bios}){ |
| 32 | ++ $conf->{bios} = 'ovmf'; |
| 33 | ++ } |
| 34 | + |
| 35 | + if (!$conf->{boot}) { |
| 36 | + my $devs = PVE::QemuServer::get_default_bootdevices($conf); |
| 37 | +@@ -1243,6 +1244,10 @@ __PACKAGE__->register_method({ |
| 38 | + $conf->{smbios1} = PVE::QemuServer::generate_smbios1_uuid(); |
| 39 | + } |
| 40 | + |
| 41 | ++ if (!$conf->{arch}) { |
| 42 | ++ $conf->{arch} = get_host_arch(); |
| 43 | ++ } |
| 44 | ++ |
| 45 | + if ((!defined($conf->{vmgenid}) || $conf->{vmgenid} eq '1') && $arch ne 'aarch64') { |
| 46 | + $conf->{vmgenid} = PVE::QemuServer::generate_uuid(); |
| 47 | + } |
| 48 | +diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm |
| 49 | +index 4214a7ca..18ab3326 100755 |
| 50 | +--- a/PVE/CLI/qm.pm |
| 51 | ++++ b/PVE/CLI/qm.pm |
| 52 | +@@ -1124,11 +1124,11 @@ our $cmddef = { |
| 53 | + my $vmlist = shift; |
| 54 | + exit 0 if (!scalar(@$vmlist)); |
| 55 | + |
| 56 | +- printf "%10s %-20s %-10s %-10s %12s %-10s\n", |
| 57 | +- qw(VMID NAME STATUS MEM(MB) BOOTDISK(GB) PID); |
| 58 | ++ printf "%10s %-20s %-12s %-10s %-10s %12s %-10s\n", |
| 59 | ++ qw(VMID NAME ARCH STATUS MEM(MB) BOOTDISK(GB) PID); |
| 60 | + |
| 61 | + foreach my $rec (sort { $a->{vmid} <=> $b->{vmid} } @$vmlist) { |
| 62 | +- printf "%10s %-20s %-10s %-10s %12.2f %-10s\n", $rec->{vmid}, $rec->{name}, |
| 63 | ++ printf "%10s %-20s %-12s %-10s %-10s %12.2f %-10s\n", $rec->{vmid}, $rec->{name}, $rec->{arch}, |
| 64 | + $rec->{qmpstatus} || $rec->{status}, |
| 65 | + ($rec->{maxmem} || 0)/(1024*1024), |
| 66 | + ($rec->{maxdisk} || 0)/(1024*1024*1024), |
| 67 | +diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm |
| 68 | +index d351dfbc..302bf73d 100644 |
| 69 | +--- a/PVE/QemuServer.pm |
| 70 | ++++ b/PVE/QemuServer.pm |
| 71 | +@@ -3017,6 +3017,7 @@ sub vmstatus { |
| 72 | + $d->{cpus} = $conf->{vcpus} if $conf->{vcpus}; |
| 73 | + |
| 74 | + $d->{name} = $conf->{name} || "VM $vmid"; |
| 75 | ++ $d->{arch} = $conf->{arch} || get_host_arch(); |
| 76 | + $d->{maxmem} = get_current_memory($conf->{memory})*(1024*1024); |
| 77 | + |
| 78 | + if ($conf->{balloon}) { |
0 commit comments