From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLF8F-00030E-8q for qemu-devel@nongnu.org; Wed, 05 Mar 2014 11:57:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLF8A-0004e2-CQ for qemu-devel@nongnu.org; Wed, 05 Mar 2014 11:57:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28946) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLF89-0004dp-Uc for qemu-devel@nongnu.org; Wed, 05 Mar 2014 11:57:18 -0500 Date: Wed, 5 Mar 2014 17:57:10 +0100 From: Igor Mammedov Message-ID: <20140305175710.106c27f6@nial.usersys.redhat.com> In-Reply-To: <53174B77.6020205@suse.de> References: <1393901749-5944-1-git-send-email-afaerber@suse.de> <1393901749-5944-2-git-send-email-afaerber@suse.de> <20140305160421.4ce44afe@nial.usersys.redhat.com> <53174B77.6020205@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu 1/6] cpu: Introduce CPUClass::parse_features() hook List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?ISO-8859-1?B?RuRyYmVy?= Cc: Alexey Kardashevskiy , qemu-devel@nongnu.org, Eduardo Habkost On Wed, 05 Mar 2014 17:06:15 +0100 Andreas F=E4rber wrote: > Am 05.03.2014 16:04, schrieb Igor Mammedov: > > On Tue, 4 Mar 2014 03:55:44 +0100 > > Andreas F=E4rber wrote: > >=20 > >> 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=E4rber > >> --- > >> 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? >=20 > Like so? "The arguments (%str) may be modified by the callback." >=20 > 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? > Thanks, > Andreas >=20 > >=20 > >> * @reset: Callback to reset the #CPUState to its initial state. > >> * @reset_dump_flags: #CPUDumpFlags to use for reset logging. > >> * @has_work: Callback for checking if there is work to do. > >> @@ -96,6 +98,7 @@ typedef struct CPUClass { > >> /*< public >*/ > >> =20 > >> ObjectClass *(*class_by_name)(const char *cpu_model); > >> + void (*parse_features)(CPUState *cpu, char *str, Error **errp); > >> =20 > >> void (*reset)(CPUState *cpu); > >> int reset_dump_flags; > [snip] >=20