From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUe6V-0003VW-Cw for qemu-devel@nongnu.org; Tue, 02 Aug 2016 14:07:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUe6S-0000yP-El for qemu-devel@nongnu.org; Tue, 02 Aug 2016 14:07:47 -0400 From: Eric Auger Date: Tue, 2 Aug 2016 20:07:22 +0200 Message-Id: <1470161247-10251-3-git-send-email-eric.auger@redhat.com> In-Reply-To: <1470161247-10251-1-git-send-email-eric.auger@redhat.com> References: <1470161247-10251-1-git-send-email-eric.auger@redhat.com> Subject: [Qemu-devel] [RFC v5 2/7] target-arm: move gicv3_class_name from machine to kvm_arm.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: eric.auger.pro@gmail.com, eric.auger@redhat.com, peter.maydell@linaro.org, qemu-arm@nongnu.org, qemu-devel@nongnu.org, p.fedin@samsung.com Cc: shlomopongratz@gmail.com, diana.craciun@freescale.com, tn@semihalf.com, shannon.zhao@linaro.org, christoffer.dall@linaro.org, drjones@redhat.com Machine.c contains code related to migration. Let's move gicv3_class_name to kvm_arm.h instead. Signed-off-by: Eric Auger Suggested-by: Peter Maydell --- v4 -> v5: - add #include "qemu/error-report.h" - rebased on target-arm: Fix unreachable code in gicv3_class_name() v4: creation Conflicts: target-arm/machine.c --- target-arm/kvm_arm.h | 16 +++++++++++++++- target-arm/machine.c | 15 --------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/target-arm/kvm_arm.h b/target-arm/kvm_arm.h index 544e404..633d088 100644 --- a/target-arm/kvm_arm.h +++ b/target-arm/kvm_arm.h @@ -13,6 +13,7 @@ #include "sysemu/kvm.h" #include "exec/memory.h" +#include "qemu/error-report.h" /** * kvm_arm_vcpu_init: @@ -223,7 +224,20 @@ static inline const char *gic_class_name(void) * * Returns: class name to use */ -const char *gicv3_class_name(void); +static inline const char *gicv3_class_name(void) +{ + if (kvm_irqchip_in_kernel()) { +#ifdef TARGET_AARCH64 + return "kvm-arm-gicv3"; +#else + error_report("KVM GICv3 acceleration is not supported on this " + "platform"); + exit(1); +#endif + } else { + return "arm-gicv3"; + } +} /** * kvm_arm_handle_debug: diff --git a/target-arm/machine.c b/target-arm/machine.c index 7a6ca31..d90943b 100644 --- a/target-arm/machine.c +++ b/target-arm/machine.c @@ -331,18 +331,3 @@ const VMStateDescription vmstate_arm_cpu = { NULL } }; - -const char *gicv3_class_name(void) -{ - if (kvm_irqchip_in_kernel()) { -#ifdef TARGET_AARCH64 - return "kvm-arm-gicv3"; -#else - error_report("KVM GICv3 acceleration is not supported on this " - "platform"); - exit(1); -#endif - } else { - return "arm-gicv3"; - } -} -- 2.5.5