[libvirt PATCH] util: canonicalize 'arm64' arch to 'aarch64'

Daniel P. Berrangé posted 1 patch 2 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20211130105345.1789721-1-berrange@redhat.com
src/util/virarch.c | 2 ++
1 file changed, 2 insertions(+)
[libvirt PATCH] util: canonicalize 'arm64' arch to 'aarch64'
Posted by Daniel P. Berrangé 2 years, 3 months ago
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>
---

NB, I suggest we push this during freeze as it is a trivial bugfix

src/util/virarch.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/virarch.c b/src/util/virarch.c
index f088b6b676..2134dd6a9d 100644
--- a/src/util/virarch.c
+++ b/src/util/virarch.c
@@ -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) {
-- 
2.33.1

Re: [libvirt PATCH] util: canonicalize 'arm64' arch to 'aarch64'
Posted by Andrea Bolognani 2 years, 3 months ago
On Tue, Nov 30, 2021 at 10:53:45AM +0000, Daniel P. Berrangé wrote:
> 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>
> ---
>
> NB, I suggest we push this during freeze as it is a trivial bugfix

  Reviewed-by: Andrea Bolognani <abologna@redhat.com>

and safe for freeze.

-- 
Andrea Bolognani / Red Hat / Virtualization