]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: canonicalize 'arm64' arch to 'aarch64'
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 30 Nov 2021 10:51:33 +0000 (10:51 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 30 Nov 2021 10:51:33 +0000 (10:51 +0000)
macOS on Apple silicon reports 'arm64' as the architecture from uname,
which we need to canonicalize to VIR_ARCH_AARCH64 / 'aarch64'.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virarch.c

index f088b6b676e9097d7d4e61f4eb5126cd8e6d2f40..2134dd6a9d0135341633cf9915a1b15e31d14732 100644 (file)
@@ -220,6 +220,8 @@ virArch virArchFromHost(void)
         arch = VIR_ARCH_I686;
     } else if (STREQ(ut.machine, "amd64")) {
         arch = VIR_ARCH_X86_64;
+    } else if (STREQ(ut.machine, "arm64")) {
+        arch = VIR_ARCH_AARCH64;
     } else {
         /* Otherwise assume the canonical name */
         if ((arch = virArchFromString(ut.machine)) == VIR_ARCH_NONE) {