]> git.proxmox.com Git - pve-container.git/commitdiff
fix #1078: accept arch parameter
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 11 Aug 2016 09:12:52 +0000 (11:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 12 Aug 2016 05:25:51 +0000 (07:25 +0200)
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>
src/PVE/LXC/Config.pm
src/PVE/LXC/Create.pm

index cfe952f2fe168c1816e08243316d2cac1204fc55..1efb178f237ec81c428317227082a478e80a3ef2 100644 (file)
@@ -865,7 +865,7 @@ sub update_pct_config {
     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;
index 98a799fc9c0ad7de62e375047a1f19329416d576..aea6ad3acc728ef479bae1dbd6cdd3180664d8f4 100644 (file)
@@ -49,7 +49,10 @@ sub restore_archive {
        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 {