we now accept the arch parameter,
when value is valid according to the JSONSchema
and skip detection on creation/restoration when we
explicitly set one
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
foreach my $opt (keys %$param) {
my $value = $param->{$opt};
my $check_protection_msg = "can't update CT $vmid drive '$opt'";
- if ($opt eq 'hostname') {
+ if ($opt eq 'hostname' || $opt eq 'arch') {
$conf->{$opt} = $value;
} elsif ($opt eq 'onboot') {
$conf->{$opt} = $value ? 1 : 0;
eval { PVE::Tools::run_command($cmd); };
}
die $@ if $@ && !$no_unpack_error;
-
+
+ # if arch is set, we do not try to autodetect it
+ return if defined($conf->{arch});
+
# determine file type of /usr/bin/file itself to get guests' architecture
$cmd = [@$userns_cmd, '/usr/bin/file', '-b', '-L', "$rootdir/bin/sh"];
PVE::Tools::run_command($cmd, outfunc => sub {