qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interfac


From: David Hildenbrand
Subject: Re: [Qemu-devel] [Patch v1 27/29] s390x/cpumodel: implement QMP interface "query-cpu-model-expansion"
Date: Tue, 2 Aug 2016 16:28:52 +0200

> On Tue, Aug 02, 2016 at 01:59:13PM +0200, David Hildenbrand wrote:
> [...]
> > +CpuModelExpansionInfo 
> > *arch_query_cpu_model_expansion(CpuModelExpansionType type,
> > +                                                      CpuModelInfo *model,
> > +                                                      Error **errp)
> > +{
> > +    CpuModelExpansionInfo *expansion_info = NULL;
> > +    S390CPUModel s390_model;
> > +    bool delta_changes = false;
> > +
> > +    /* convert it to our internal representation */
> > +    cpu_model_from_info(&s390_model, model, errp);
> > +    if (*errp) {
> > +        return NULL;
> > +    }
> > +
> > +    if (type == CPU_MODEL_EXPANSION_TYPE_STATIC) {
> > +        delta_changes = true;
> > +    }  
> 
> This assumes the only valid values for type will always be
> "static" and "full". I would check explicitly for
> CPU_MODEL_EXPANSION_TYPE_STATIC and CPU_MODEL_EXPANSION_TYPE_FULL
> and return an error otherwise, just in case CpuModelExpansionType
> is extended to include other expansion modes in the future.

I actually also had that in mind :) Will add that check!

Thanks!

David




reply via email to

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