qemu-devel
[Top][All Lists]
Advanced

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

Re: [PULL 29/87] kvm: convert "-machine kernel_irqchip" to an accelerato


From: Paolo Bonzini
Subject: Re: [PULL 29/87] kvm: convert "-machine kernel_irqchip" to an accelerator property
Date: Tue, 7 Jan 2020 17:18:31 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

On 07/01/20 15:46, Peter Maydell wrote:
> On Wed, 18 Dec 2019 at 12:26, Paolo Bonzini <address@hidden> wrote:
>>
>> Signed-off-by: Paolo Bonzini <address@hidden>
> 
>> +static void kvm_set_kernel_irqchip(Object *obj, Visitor *v,
>> +                                   const char *name, void *opaque,
>> +                                   Error **errp)
>> +{
>> +    Error *err = NULL;
>> +    KVMState *s = KVM_STATE(obj);
>> +    OnOffSplit mode;
>> +
>> +    visit_type_OnOffSplit(v, name, &mode, &err);
> 
> Coverity complains that this call uses 'mode' uninitialized,
> which seems correct since it starts off with 'value = *obj'.
> (CID 1412230)

The visitor here is not supposed to look at value (rather it should fill
it in)---but yeah this is an ugly part of the visitor API that we can
work around most simply by initializing mode.

Paolo

> 
>> +    if (err) {
>> +        error_propagate(errp, err);
>> +        return;
>> +    } else {
>> +        switch (mode) {
>> +        case ON_OFF_SPLIT_ON:
>> +            s->kernel_irqchip_allowed = true;
>> +            s->kernel_irqchip_required = true;
>> +            s->kernel_irqchip_split = false;
>> +            break;
>> +        case ON_OFF_SPLIT_OFF:
>> +            s->kernel_irqchip_allowed = false;
>> +            s->kernel_irqchip_required = false;
>> +            s->kernel_irqchip_split = false;
>> +            break;
>> +        case ON_OFF_SPLIT_SPLIT:
>> +            s->kernel_irqchip_allowed = true;
>> +            s->kernel_irqchip_required = true;
>> +            s->kernel_irqchip_split = true;
>> +            break;
>> +        default:
>> +            /* The value was checked in visit_type_OnOffSplit() above. If
>> +             * we get here, then something is wrong in QEMU.
>> +             */
>> +            abort();
>> +        }
>> +    }
>> +}
> 
> 
> thanks
> -- PMM
> 




reply via email to

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