On 19/09/14 00:57, Anup Patel wrote:
> The KVM_EXIT_SYSTEM_EVENT exit reason was added to define
> architecture independent system-wide events for a Guest.
> 
> Currently, it is used by in-kernel PSCI-0.2 emulation of
> KVM ARM/ARM64 to inform user space about PSCI SYSTEM_OFF
> or PSCI SYSTEM_RESET request.
> 
> For now, we simply treat all system-wide guest events as
> shutdown request in KVMTOOL.
> 
> Signed-off-by: Pranavkumar Sawargaonkar <[email protected]>
> Signed-off-by: Anup Patel <[email protected]>
> ---
>  tools/kvm/kvm-cpu.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
> index ee0a8ec..5180039 100644
> --- a/tools/kvm/kvm-cpu.c
> +++ b/tools/kvm/kvm-cpu.c
> @@ -160,6 +160,27 @@ int kvm_cpu__start(struct kvm_cpu *cpu)
>                       goto exit_kvm;
>               case KVM_EXIT_SHUTDOWN:
>                       goto exit_kvm;
> +             case KVM_EXIT_SYSTEM_EVENT:
> +                     /*
> +                      * Print the type of system event and
> +                      * treat all system events as shutdown request.
> +                      */
> +                     switch (cpu->kvm_run->system_event.type) {
> +                     case KVM_SYSTEM_EVENT_SHUTDOWN:
> +                             printf("  # Info: shutdown system event\n");
> +                             goto exit_kvm;
> +                     case KVM_SYSTEM_EVENT_RESET:
> +                             printf("  # Info: reset system event\n");
> +                             printf("  # Info: KVMTOOL does not support VM 
> reset\n");
> +                             printf("  # Info: please re-launch the VM 
> manually\n");
> +                             goto exit_kvm;
> +                     default:
> +                             printf("  # Warning: unknown system event 
> type=%d\n",
> +                                    cpu->kvm_run->system_event.type);
> +                             printf("  # Info: exiting KVMTOOL\n");
> +                             goto exit_kvm;
> +                     };
> +                     break;
>               default: {
>                       bool ret;
>  
> 

Looks good to me.

Reviewed-by: Andre Przywara <[email protected]>

Cheers,
Andre.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to