From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl29r-0004WJ-M9 for qemu-devel@nongnu.org; Tue, 18 Dec 2012 13:44:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tl29q-00040w-6Y for qemu-devel@nongnu.org; Tue, 18 Dec 2012 13:44:51 -0500 Received: from cantor2.suse.de ([195.135.220.15]:56127 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tl29p-00040b-T9 for qemu-devel@nongnu.org; Tue, 18 Dec 2012 13:44:50 -0500 Message-ID: <50D0B994.10203@suse.de> Date: Tue, 18 Dec 2012 19:44:36 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1355817223-13076-1-git-send-email-afaerber@suse.de> <1355817223-13076-2-git-send-email-afaerber@suse.de> <20121218165952.41188eae@nial.usersys.redhat.com> In-Reply-To: <20121218165952.41188eae@nial.usersys.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH qom-cpu 1/4] cpu: Introduce CPUListState struct List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: Peter Maydell , Richard Henderson , qemu-devel@nongnu.org, David Gibson , Paul Brook Am 18.12.2012 16:59, schrieb Igor Mammedov: > On Tue, 18 Dec 2012 08:53:40 +0100 > Andreas F=E4rber wrote: >=20 >> This generalizes {ARM,M68k,Alpha}CPUListState to avoid declaring it fo= r >> each target. >> >> Signed-off-by: Andreas F=E4rber >> --- >> include/qemu/cpu.h | 12 ++++++++++++ >> target-alpha/cpu.c | 9 ++------- >> target-arm/helper.c | 9 ++------- >> target-m68k/helper.c | 9 ++------- >> 4 Dateien ge=E4ndert, 18 Zeilen hinzugef=FCgt(+), 21 Zeilen entfernt(= -) >> >=20 > Could we use cpus.h for CPUListState? >=20 > It has related list_cpus() and it doesn't included in any headers yet. > And we won't pollute base CPU qom definition with utility structures. I'd be open for another header, but it's probably orthogonal to the qemu-common.h dependency issue. Note however that I have been moving the QOM-cleaned-up declarations of CPU functions to qemu/cpu.h as the canonical CPU header as well. CPUListState does not contain CPUState in any way, it's more for the target than for the actual CPU, so that's a good point to investigate. >> diff --git a/target-alpha/cpu.c b/target-alpha/cpu.c >> index d065085..915278f 100644 >> --- a/target-alpha/cpu.c >> +++ b/target-alpha/cpu.c >> @@ -33,11 +33,6 @@ static void alpha_cpu_realize(Object *obj, Error **= err) >> #endif >> } >> =20 >> -typedef struct AlphaCPUListState { >> - fprintf_function cpu_fprintf; >> - FILE *file; >> -} AlphaCPUListState; >> - >> /* Sort alphabetically by type name. */ >> static gint alpha_cpu_list_compare(gconstpointer a, gconstpointer b) >> { >> @@ -53,7 +48,7 @@ static gint alpha_cpu_list_compare(gconstpointer a, >> gconstpointer b) static void alpha_cpu_list_entry(gpointer data, gpoin= ter > Perhaps *cpu_list_entry() could be generalized too, they all look alike= . Actually, apart from varying indentation and whether or not they're prefixed with the architecture, some print more information than just the class name. In particular other targets print just the base name for backwards compatibility (something that I could optionally change for alpha, where we don't have any to keep). What I was considering was to move to a general location a GCompareFunc comparing just the ObjectClass names. But so far there's always exceptions to that rule (any, host, PVR order, new vs. old naming scheme, ...) so that no two are identical yet. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg