From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtvT-0000am-6G for qemu-devel@nongnu.org; Thu, 02 May 2013 09:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXtvN-0001Zw-OA for qemu-devel@nongnu.org; Thu, 02 May 2013 09:51:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXtvN-0001Zh-HF for qemu-devel@nongnu.org; Thu, 02 May 2013 09:51:53 -0400 Date: Thu, 2 May 2013 16:51:43 +0300 From: "Michael S. Tsirkin" Message-ID: <20130502135143.GA1171@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] posting patches in pull requests (was Re: [PATCH 08/29] cpu: Add qemu_for_each_cpu()) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org Anthony, can we please make it a rule that all patches in pull request are tagged specially? As it is, patchwork is full of patches that were already reviewed and merged, all my scripts that were filtering and sorting patches are also useless, and I get to wade through each patch for the second time. Maybe you could teach your scripts to ignore [PULL X/Y] where X>0? This way people could tag all resent patches as PULL. Further, PULL 0/2 PULL 1/2 PULL 2/2 aligns better than PULL 0/2 PATCH 1/2 PATCH 2/2 On Thu, May 02, 2013 at 03:35:34PM +0200, Andreas F=E4rber wrote: > From: "Michael S. Tsirkin" >=20 > Wrapper to avoid open-coded loops and to make CPUState iteration > independent of CPUArchState. >=20 > Signed-off-by: Michael S. Tsirkin > Signed-off-by: Igor Mammedov > Signed-off-by: Andreas F=E4rber > --- > exec.c | 10 ++++++++++ > include/qom/cpu.h | 9 +++++++++ > 2 files changed, 19 insertions(+) >=20 > diff --git a/exec.c b/exec.c > index fa1e0c3..19725db 100644 > --- a/exec.c > +++ b/exec.c > @@ -265,6 +265,16 @@ CPUState *qemu_get_cpu(int index) > return env ? cpu : NULL; > } > =20 > +void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *= data) > +{ > + CPUArchState *env =3D first_cpu; > + > + while (env) { > + func(ENV_GET_CPU(env), data); > + env =3D env->next_cpu; > + } > +} > + > void cpu_exec_init(CPUArchState *env) > { > CPUState *cpu =3D ENV_GET_CPU(env); > diff --git a/include/qom/cpu.h b/include/qom/cpu.h > index 1b4de17..a28e5ff 100644 > --- a/include/qom/cpu.h > +++ b/include/qom/cpu.h > @@ -216,6 +216,15 @@ bool cpu_is_stopped(CPUState *cpu); > void run_on_cpu(CPUState *cpu, void (*func)(void *data), void *data); > =20 > /** > + * qemu_for_each_cpu: > + * @func: The function to be executed. > + * @data: Data to pass to the function. > + * > + * Executes @func for each CPU. > + */ > +void qemu_for_each_cpu(void (*func)(CPUState *cpu, void *data), void *= data); > + > +/** > * qemu_get_cpu: > * @index: The CPUState@cpu_index value of the CPU to obtain. > * > --=20 > 1.8.1.4