Re: [PATCH v3 3/4] kvmtool: Handle exit reason KVM_EXIT_SYSTEM_EVENT

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

 



On Thu, Sep 11, 2014 at 9:56 PM, Andre Przywara <andre.przywara@xxxxxxx> wrote:
>
> On 08/09/14 09:17, 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.
>
> Is that really a good idea to default to exit_kvm?
> I find a shutdown a rather drastic default.
> Also I'd like to see RESET not easily mapped to shutdown. If the user
> resets the box explicitly, it's probably expected to come up again (to
> load an updated kernel or proceed with an install).

Absolutely correct but we don't have VM reboot API in KVMTOOL
so I choose this route.

> So what about a more explicit message like: "... please restart the VM"
> until we gain proper reboot support in kvmtool?

Sure, I will print additional info for reset event such as:
INFO: VM reboot support not available
INFO: Please restart the VM manually

Regards,
Anup

>
> Regards,
> Andre.
>
>> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@xxxxxxxxxx>
>> Signed-off-by: Anup Patel <anup.patel@xxxxxxxxxx>
>> ---
>>  tools/kvm/kvm-cpu.c |   19 +++++++++++++++++++
>>  1 file changed, 19 insertions(+)
>>
>> diff --git a/tools/kvm/kvm-cpu.c b/tools/kvm/kvm-cpu.c
>> index ee0a8ec..6d01192 100644
>> --- a/tools/kvm/kvm-cpu.c
>> +++ b/tools/kvm/kvm-cpu.c
>> @@ -160,6 +160,25 @@ 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");
>> +                             break;
>> +                     case KVM_SYSTEM_EVENT_RESET:
>> +                             printf("  # Info: reset system event\n");
>> +                             break;
>> +                     default:
>> +                             printf("  # Warning: unknown system event type=%d\n",
>> +                                    cpu->kvm_run->system_event.type);
>> +                             break;
>> +                     };
>> +                     printf("  # Info: exiting KVMTOOL\n");
>> +                     goto exit_kvm;
>>               default: {
>>                       bool ret;
>>
>>
> CONFIDENTIALITY NOTICE: This e-mail message, including any attachments,
> is for the sole use of the intended recipient(s) and contains information
> that is confidential and proprietary to Applied Micro Circuits Corporation or its subsidiaries.
> It is to be used solely for the purpose of furthering the parties' business relationship.
> All unauthorized review, use, disclosure or distribution is prohibited.
> If you are not the intended recipient, please contact the sender by reply e-mail
> and destroy all copies of the original message.
>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux