diff mbox

[5/6] Add parsing of AArch64 qemu capabilities.

Message ID 1381240151-15060-6-git-send-email-pranavkumar@linaro.org
State New
Headers show

Commit Message

PranavkumarSawargaonkar Oct. 8, 2013, 1:49 p.m. UTC
Parse qemu capabilities AArch64 just like arm 32bit.

Signed-off-by: Anup Patel <anup.patel@linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
---
 src/qemu/qemu_capabilities.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Cole Robinson Oct. 9, 2013, 1:56 p.m. UTC | #1
On 10/08/2013 09:49 AM, Pranavkumar Sawargaonkar wrote:
> Parse qemu capabilities AArch64 just like arm 32bit.
> 
> Signed-off-by: Anup Patel <anup.patel@linaro.org>
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> ---
>  src/qemu/qemu_capabilities.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 7c39c1c..1eae4ba 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -300,6 +300,8 @@ static virArch virQEMUCapsArchFromString(const char *arch)
>          return VIR_ARCH_I686;
>      if (STREQ(arch, "arm"))
>          return VIR_ARCH_ARMV7L;
> +    if (STREQ(arch, "aarch64"))
> +        return VIR_ARCH_AARCH64;
>  
>      return virArchFromString(arch);
>  }
> @@ -311,6 +313,8 @@ static const char *virQEMUCapsArchToString(virArch arch)
>          return "i386";
>      else if (arch == VIR_ARCH_ARMV7L)
>          return "arm";
> +    else if (arch == VIR_ARCH_AARCH64)
> +        return "aarch64";
>  
>      return virArchToString(arch);
>  }
> 

ACK

- Cole
Daniel P. Berrangé Oct. 9, 2013, 2:51 p.m. UTC | #2
On Tue, Oct 08, 2013 at 07:19:10PM +0530, Pranavkumar Sawargaonkar wrote:
> Parse qemu capabilities AArch64 just like arm 32bit.
> 
> Signed-off-by: Anup Patel <anup.patel@linaro.org>
> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
> ---
>  src/qemu/qemu_capabilities.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 7c39c1c..1eae4ba 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -300,6 +300,8 @@ static virArch virQEMUCapsArchFromString(const char *arch)
>          return VIR_ARCH_I686;
>      if (STREQ(arch, "arm"))
>          return VIR_ARCH_ARMV7L;
> +    if (STREQ(arch, "aarch64"))
> +        return VIR_ARCH_AARCH64;
>  
>      return virArchFromString(arch);
>  }
> @@ -311,6 +313,8 @@ static const char *virQEMUCapsArchToString(virArch arch)
>          return "i386";
>      else if (arch == VIR_ARCH_ARMV7L)
>          return "arm";
> +    else if (arch == VIR_ARCH_AARCH64)
> +        return "aarch64";
>  
>      return virArchToString(arch);
>  }

This shouldn't be required. The QEMU code only needs to have special
entries if the qemu-system-XXXX name does not match the kernel
arch name.

eg for 32-bit arm we have  armv7l for uname and arm for QEMU system
emulator. For 64-bit arm, IIUC,  we have aarch64 everywhere, so can
rely on virArch{To,From}String just doing the right thing.

Daniel
diff mbox

Patch

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7c39c1c..1eae4ba 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -300,6 +300,8 @@  static virArch virQEMUCapsArchFromString(const char *arch)
         return VIR_ARCH_I686;
     if (STREQ(arch, "arm"))
         return VIR_ARCH_ARMV7L;
+    if (STREQ(arch, "aarch64"))
+        return VIR_ARCH_AARCH64;
 
     return virArchFromString(arch);
 }
@@ -311,6 +313,8 @@  static const char *virQEMUCapsArchToString(virArch arch)
         return "i386";
     else if (arch == VIR_ARCH_ARMV7L)
         return "arm";
+    else if (arch == VIR_ARCH_AARCH64)
+        return "aarch64";
 
     return virArchToString(arch);
 }