qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] arm_gic_kvm: Disable live migration if not s


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2] arm_gic_kvm: Disable live migration if not supported
Date: Fri, 16 Oct 2015 14:46:12 +0100

On 16 October 2015 at 14:43, Pavel Fedin <address@hidden> wrote:
> Currently, if the kernel does not have live migration API, the migration
> will still be attempted, but vGIC save/restore functions will just not do
> anything. This will result in a broken machine state.
>
> This patch fixes the problem by adding migration blocker if kernel API is
> not supported.
>
> Signed-off-by: Pavel Fedin <address@hidden>
> ---
> v1 => v2:
> Do not hack VMState, use migrate_add_blocker() instead
> ---
>  hw/intc/arm_gic_kvm.c            | 22 +++++++++++-----------
>  include/hw/intc/arm_gic_common.h |  1 +
>  2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c
> index e8b2386..0ceebbf 100644
> --- a/hw/intc/arm_gic_kvm.c
> +++ b/hw/intc/arm_gic_kvm.c
> @@ -20,6 +20,7 @@
>   */
>
>  #include "hw/sysbus.h"
> +#include "migration/migration.h"
>  #include "sysemu/kvm.h"
>  #include "kvm_arm.h"
>  #include "gic_internal.h"
> @@ -307,11 +308,6 @@ static void kvm_arm_gic_put(GICState *s)
>      int num_cpu;
>      int num_irq;
>
> -    if (!kvm_arm_gic_can_save_restore(s)) {
> -            DPRINTF("Cannot put kernel gic state, no kernel interface");
> -            return;
> -    }
> -
>      /* Note: We do the restore in a slightly different order than the save
>       * (where the order doesn't matter and is simply ordered according to the
>       * register offset values */
> @@ -411,11 +407,6 @@ static void kvm_arm_gic_get(GICState *s)
>      int i;
>      int cpu;
>
> -    if (!kvm_arm_gic_can_save_restore(s)) {
> -            DPRINTF("Cannot get kernel gic state, no kernel interface");
> -            return;
> -    }
> -
>      /*****************************************************************
>       * Distributor State
>       */
> @@ -503,7 +494,10 @@ static void kvm_arm_gic_reset(DeviceState *dev)
>      KVMARMGICClass *kgc = KVM_ARM_GIC_GET_CLASS(s);
>
>      kgc->parent_reset(dev);
> -    kvm_arm_gic_put(s);
> +
> +    if (kvm_arm_gic_can_save_restore(s)) {
> +        kvm_arm_gic_put(s);
> +    }

Why change the reset method in a patch that's dealing with adding
a warning about migration?

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]