From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVOOA-0006Um-7K for qemu-devel@nongnu.org; Thu, 25 Apr 2013 11:47:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVOO5-00064n-CW for qemu-devel@nongnu.org; Thu, 25 Apr 2013 11:47:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:41672 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVOO5-0005ye-3v for qemu-devel@nongnu.org; Thu, 25 Apr 2013 11:47:09 -0400 Message-ID: <51794FE5.3020005@suse.de> Date: Thu, 25 Apr 2013 17:46:45 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1366898737-6201-1-git-send-email-imammedo@redhat.com> <1366898737-6201-3-git-send-email-imammedo@redhat.com> In-Reply-To: <1366898737-6201-3-git-send-email-imammedo@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 02/15] cpu: add helper cpu_exists(), to check if CPU with specified id exists List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, ehabkost@redhat.com, mst@redhat.com, stefano.stabellini@eu.citrix.com, qemu-devel@nongnu.org, quintela@redhat.com, anthony.perard@citrix.com, pbonzini@redhat.com Am 25.04.2013 16:05, schrieb Igor Mammedov: > Signed-off-by: Igor Mammedov > --- > v3: > * use qemu_for_each_cpu() instead of recursion > v2: > * s/get_firmware_id()/get_arch_id()/ rebase fixup > * remove check for get_arch_id being NULL, since it's always defined > --- > include/qom/cpu.h | 10 ++++++++++ > qom/cpu.c | 26 ++++++++++++++++++++++++++ > 2 files changed, 36 insertions(+), 0 deletions(-) Thanks, applied to qom-cpu (with gtk-doc and Coding Style fixes below): https://github.com/afaerber/qemu-cpu/commits/qom-cpu Andreas diff --git a/include/qom/cpu.h b/include/qom/cpu.h index d7746dd..e54579b 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -236,11 +236,11 @@ CPUState *qemu_get_cpu(int index); /** * cpu_exists: - * @id - guest exposed CPU ID to lookup + * @id: Guest-exposed CPU ID to lookup. * * Search for CPU with specified ID. * - * Returns: true - CPU is found, false - CPU isn't found + * Returns: %true - CPU is found, %false - CPU isn't found. */ bool cpu_exists(int64_t id); diff --git a/qom/cpu.c b/qom/cpu.c index 3f79398..3dc8208 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -24,15 +24,15 @@ #include "qemu/notify.h" #include "sysemu/sysemu.h" -typedef struct CPU_exists_args { +typedef struct CPUExistsArgs { int64_t id; bool found; -} CPU_exists_args; +} CPUExistsArgs; static void cpu_exist_cb(CPUState *cpu, void *data) { CPUClass *klass =3D CPU_GET_CLASS(cpu); - CPU_exists_args *arg =3D data; + CPUExistsArgs *arg =3D data; if (klass->get_arch_id(cpu) =3D=3D arg->id) { arg->found =3D true; @@ -41,7 +41,7 @@ static void cpu_exist_cb(CPUState *cpu, void *data) bool cpu_exists(int64_t id) { - CPU_exists_args data =3D { + CPUExistsArgs data =3D { .id =3D id, .found =3D false, }; --=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