Hi
On 06/07/2016 11:46, Eric Auger wrote:
> Machine.c contains code related to migration. Let's move
> gicv3_class_name to kvm_arm.h instead.
>
> Signed-off-by: Eric Auger <[email protected]>
> Suggested-by: Peter Maydell <[email protected]>
>
> ---
>
> v4: creation
> ---
> target-arm/kvm_arm.h | 16 +++++++++++++++-
> target-arm/machine.c | 16 ----------------
> 2 files changed, 15 insertions(+), 17 deletions(-)
>
> diff --git a/target-arm/kvm_arm.h b/target-arm/kvm_arm.h
> index 544e404..4fb6d15 100644
> --- a/target-arm/kvm_arm.h
> +++ b/target-arm/kvm_arm.h
> @@ -223,7 +223,21 @@ 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");
this fails to compile without adding
#include "qemu/error-report.h"
I will correct this on the next version.
Sorry for the oversight.
Best Regards
Eric
> +#endif
> + } else {
> + return "arm-gicv3";
> + }
> +
> + exit(1);
> +}
>
> /**
> * kvm_arm_handle_debug:
> diff --git a/target-arm/machine.c b/target-arm/machine.c
> index 2dbeb82..d90943b 100644
> --- a/target-arm/machine.c
> +++ b/target-arm/machine.c
> @@ -331,19 +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");
> -#endif
> - } else {
> - return "arm-gicv3";
> - }
> -
> - exit(1);
> -}
>