From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPTD4-0006NX-G5 for qemu-devel@nongnu.org; Mon, 26 Jun 2017 08:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dPTCz-0000la-K3 for qemu-devel@nongnu.org; Mon, 26 Jun 2017 08:33:42 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:58792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dPTCy-0000ip-NY for qemu-devel@nongnu.org; Mon, 26 Jun 2017 08:33:37 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <149727922719.28532.11985025310576184920.stgit@frigg.lan> <149727924253.28532.2681638904562623104.stgit@frigg.lan> Date: Mon, 26 Jun 2017 15:33:13 +0300 In-Reply-To: (Richard Henderson's message of "Mon, 19 Jun 2017 16:20:55 -0700") Message-ID: <877ezzapyu.fsf@frigg.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v6 2/6] queue: Add macro for incremental traversal List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Paolo Bonzini , Peter Crosthwaite , Alex =?utf-8?Q?Benn=C3=A9e?= Richard Henderson writes: > On 06/12/2017 07:54 AM, Llu=C3=ADs Vilanova wrote: >> Adds macro QTAILQ_FOREACH_CONTINUE to support incremental list >> traversal. >>=20 >> Signed-off-by: Llu=C3=ADs Vilanova >> --- >> include/qemu/queue.h | 12 ++++++++++++ >> 1 file changed, 12 insertions(+) >>=20 >> diff --git a/include/qemu/queue.h b/include/qemu/queue.h >> index 35292c3155..eb2bf9cb1c 100644 >> --- a/include/qemu/queue.h >> +++ b/include/qemu/queue.h >> @@ -415,6 +415,18 @@ struct { = \ >> (var); \ >> (var) =3D ((var)->field.tqe_next)) >> +/** >> + * QTAILQ_FOREACH_CONTINUE: >> + * @var: Variable to resume iteration from. >> + * @field: Field in @var holding a QTAILQ_ENTRY for this queue. >> + * >> + * Resumes iteration on a queue from the element in @var. >> + */ >> +#define QTAILQ_FOREACH_CONTINUE(var, field) = \ >> + for ((var) =3D ((var)->field.tqe_next); = \ >> + (var); = \ >> + (var) =3D ((var)->field.tqe_next)) >> + >> #define QTAILQ_FOREACH_SAFE(var, head, field, next_var) \ >> for ((var) =3D ((head)->tqh_first); \ >> (var) && ((next_var) =3D ((var)->field.tqe_next), 1); \ >>=20 >>=20 > I still say this isn't required if the breakpoint loop is better structur= ed. I can embed the use of QTAILQ into translate-block.c, but I wanted to keep = the implementation of breakpoint lists hidden behind the cpu_breakpoint API. Thanks, Lluis