qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC v20 1/8] target/avr: Add outward facing inte


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH RFC v20 1/8] target/avr: Add outward facing interfaces and core CPU logic
Date: Fri, 31 May 2019 11:56:55 +0200

On Fri, 31 May 2019 11:15:01 +0300
Michael Rolnik <address@hidden> wrote:

> Hi Igor.
> 
> Please explain what I should do.
Maybe look at inline comments which are somewhere in the body of reply.

> thank you,
> Michael
> 
> On Fri, May 31, 2019 at 11:02 AM Igor Mammedov <address@hidden> wrote:
> 
> > On Thu, 30 May 2019 22:07:31 +0300
> > Michael Rolnik <address@hidden> wrote:
[...]

> > > +static ObjectClass *avr_cpu_class_by_name(const char *cpu_model)
> > > +{
> > > +    ObjectClass *oc;
> > > +    char *name;
> > > +
> > > +    if (!cpu_model) {
> > > +        return NULL;
> > > +    }
> > > +
> > > +    oc = object_class_by_name(cpu_model);
> > > +    if (oc != NULL && object_class_dynamic_cast(oc, TYPE_AVR_CPU) !=  
> > NULL &&  
> > > +        !object_class_is_abstract(oc)) {
> > > +        return oc;
> > > +    }  
> >
> > In other targets QEMU has 1-2 or more naming variants but that were
> > influenced
> > by legacy code and we have to keep compatibility not to break existing
> > configurations.
> >
> > In case of new cpu, I'd keep only above hunk and drop the rest so that
> > only one naming scheme would be available, which is compatible with
> > '-device' naming and QMP/monitor interfaces that we support.
> >

I've suggested to leave only above hunk and drop following hunk.
this way only full cpu type name will be accepted by '-cpu'

> > > +    name = g_strdup_printf(AVR_CPU_TYPE_NAME("%s"), cpu_model);
> > > +    oc = object_class_by_name(name);
> > > +    g_free(name);
> > > +    if (oc != NULL && object_class_dynamic_cast(oc, TYPE_AVR_CPU) !=  
> > NULL &&  
> > > +        !object_class_is_abstract(oc)) {
> > > +        return oc;
> > > +    }

since suffix trick will be removed, you'll probably need to
amend/simplify avr_cpu_list_entry() as well.

> > > +    return NULL;
> > > +}
> > > +
[...]




reply via email to

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