qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 1/1] s390x/cpu: expose the guest crash inform


From: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH v5 1/1] s390x/cpu: expose the guest crash information
Date: Tue, 6 Feb 2018 19:21:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2


On 02/06/2018 04:31 PM, Eric Blake wrote:
> On 02/06/2018 01:46 AM, Christian Borntraeger wrote:
>> This patch is the s390 implementation of guest crash information,
>> similar to commit d187e08dc4 ("i386/cpu: add crash-information QOM
>> property") and the related commits. We will detect several crash
>> reasons, with the "disabled wait" being the most important one, since
>> this is used by all s390 guests as a "panic like" notification.
>>
> 
>>
>> Co-authored-by: Jing Liu <address@hidden>
>> Signed-off-by: Christian Borntraeger <address@hidden>
>> ---
>>   qapi/run-state.json   | 27 ++++++++++++++++++++++--
>>   target/s390x/cpu.c    | 57 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++
>>   target/s390x/cpu.h    | 11 ++++++++++
>>   target/s390x/helper.c |  5 ++++-
>>   target/s390x/kvm.c    | 15 +++++++-------
>>   vl.c                  |  6 ++++++
>>   6 files changed, 110 insertions(+), 11 deletions(-)
>>
> 
>>
>>  ##
>>  # @GuestPanicInformation:
>>  #
>>  # Information about a guest panic
>>  #
>> +# @type: Crash type that defines the hypervisor specific information
>> +#
>>  # Since: 2.9
>>  ##
>>  {'union': 'GuestPanicInformation',
>>   'base': {'type': 'GuestPanicInformationType'},
>>   'discriminator': 'type',
>> - 'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
>> + 'data': { 'hyper-v': 'GuestPanicInformationHyperV',
>> +           's390': 'GuestPanicInformationS390' } }
>>  
> 
> The qapi type has only integers (that the caller will presumably know how to 
> decode if it cares) and a human readable string.  Meanwhile,...
> 
>>
>> +/* Crash cases. */
>> +enum crash_reasons {
> 
> Doesn't seem to match our usual coding conventions of CamelCase for names in 
> the enum/struct/union namespace.

yes, needs fixing
> 
>> +    CRASH_REASON_UNKNOWN,  /* default value of 0 on reset */
>> +    CRASH_REASON_PGM,
>> +    CRASH_REASON_EXT,
>> +    CRASH_REASON_WAITPSW,
>> +    CRASH_REASON_OPEREXC,
> 
> ...you have an internal enum for decoding some of those integer values into 
> specific human readable strings, but don't expose the enum over QAPI.  Are we 
> sure that's the interface we want to go with?  As long as you are okay with 
> that, then I can live with the interface change; I just want to make sure 
> that you are certain that the machine-based consumer of the QMP command does 
> not need to decode crash_reasons because you left it as an internal enum.

We might want to have temporary or intermediate crash reasons (e.g. emulation 
failure or whatever), 
so not requiring changes in both components might be less error prone. (the way 
it is today)
But if there is a strong wish for an on-the-wire enum, we could do that as well.
> 
>> +
>> +static void s390_cpu_get_crash_info_qom(Object *obj, Visitor *v,
>> +                                         const char *name, void *opaque,
>> +                                         Error **errp)
> 
> Indentation is off.

I blame Conny who requested an s/s390x/s390/ change :-p




reply via email to

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