[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH qom-cpu 1/6] cpu: Introduce CPUClass::parse_feat
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH qom-cpu 1/6] cpu: Introduce CPUClass::parse_features() hook |
Date: |
Wed, 5 Mar 2014 19:31:16 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Mar 05, 2014 at 05:57:10PM +0100, Igor Mammedov wrote:
> On Wed, 05 Mar 2014 17:06:15 +0100
> Andreas Färber <address@hidden> wrote:
>
> > Am 05.03.2014 16:04, schrieb Igor Mammedov:
> > > On Tue, 4 Mar 2014 03:55:44 +0100
> > > Andreas Färber <address@hidden> wrote:
> > >
> > >> Adapt the X86CPU implementation to suit the generic hook.
> > >> This involves a cleanup of error handling to cope with NULL errp.
> > >>
> > >> Signed-off-by: Andreas Färber <address@hidden>
> > >> ---
> > >> include/qom/cpu.h | 3 +++
> > >> target-i386/cpu.c | 36 +++++++++++++++++++++---------------
> > >> 2 files changed, 24 insertions(+), 15 deletions(-)
> > >>
> > >> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> > >> index 64ebfa5..43d253a 100644
> > >> --- a/include/qom/cpu.h
> > >> +++ b/include/qom/cpu.h
> > >> @@ -67,6 +67,8 @@ struct TranslationBlock;
> > >> * CPUClass:
> > >> * @class_by_name: Callback to map -cpu command line model name to an
> > >> * instantiatable CPU type.
> > >> + * @parse_features: Callback to parse command line arguments.
> > >> + * The argument may be modified by the callback.
> > > Could you specify which argument is expected to be modified?
> >
> > Like so? "The arguments (%str) may be modified by the callback."
> >
> > Alternatively I could drop that line, given that it's not const char *.
> > Or add a typedef for the callback and document it there using @str syntax.
> I'd prefer to drop it.
>
> BTW: why is 'str' modified by callback?
Allowing it to be modified allows (for example) strtok() to be used
(like we do on the i386 code today). So I don't see a reason to forbid
it.
--
Eduardo
Re: [Qemu-devel] [PATCH qom-cpu 1/6] cpu: Introduce CPUClass::parse_features() hook, Andreas Färber, 2014/03/09
[Qemu-devel] [PATCH qom-cpu 4/6] target-sparc: Defer SPARCCPU feature inference to QOM realize, Andreas Färber, 2014/03/03
[Qemu-devel] [PATCH qom-cpu 5/6] cpu: Implement CPUClass::parse_features() for the rest of CPUs, Andreas Färber, 2014/03/03
[Qemu-devel] [PATCH qom-cpu 2/6] target-sparc: Use error_report() for CPU error reporting, Andreas Färber, 2014/03/03
[Qemu-devel] [PATCH qom-cpu 3/6] target-sparc: Implement CPUClass::parse_features() for SPARCCPU, Andreas Färber, 2014/03/03
[Qemu-devel] [PATCH qom-cpu 6/6] cpu: Factor out cpu_generic_init(), Andreas Färber, 2014/03/03
Re: [Qemu-devel] [PATCH qom-cpu 0/6] cpu: Unifying features parsing, Andreas Färber, 2014/03/04