From: Markus Armbruster <armbru@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: kwolf@redhat.com, den@openvz.org, qemu-devel@nongnu.org,
qemu-block@nongnu.org, mreitz@redhat.com
Subject: Re: [PATCH 1/7] qemu/queue: add some useful QLIST_ and QTAILQ_ macros
Date: Mon, 01 Feb 2021 09:29:34 +0100 [thread overview]
Message-ID: <87v9bcfaxd.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20210129165030.640169-2-vsementsov@virtuozzo.com> (Vladimir Sementsov-Ogievskiy's message of "Fri, 29 Jan 2021 19:50:24 +0300")
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:
> Add QLIST_FOREACH_FUNC_SAFE(), QTAILQ_FOREACH_FUNC_SAFE() and
> QTAILQ_POP_HEAD(), to be used in following commit.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> include/qemu/queue.h | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/include/qemu/queue.h b/include/qemu/queue.h
> index e029e7bf66..03e1fce85f 100644
> --- a/include/qemu/queue.h
> +++ b/include/qemu/queue.h
> @@ -173,6 +173,13 @@ struct { \
> (var) && ((next_var) = ((var)->field.le_next), 1); \
> (var) = (next_var))
>
> +#define QLIST_FOREACH_FUNC_SAFE(head, field, func) do { \
> + typeof(*QLIST_FIRST(head)) *qffs_var, *qffs_next_var; \
> + QLIST_FOREACH_SAFE(qffs_var, (head), field, qffs_next_var) { \
> + (func)(qffs_var); \
> + } \
> +} while (/*CONSTCOND*/0)
> +
> /*
> * List access methods.
> */
> @@ -490,6 +497,13 @@ union { \
> (var) && ((prev_var) = QTAILQ_PREV(var, field), 1); \
> (var) = (prev_var))
>
> +#define QTAILQ_FOREACH_FUNC_SAFE(head, field, func) do { \
> + typeof(*QTAILQ_FIRST(head)) *qffs_var, *qffs_next_var; \
> + QTAILQ_FOREACH_SAFE(qffs_var, (head), field, qffs_next_var) { \
> + (func)(qffs_var); \
> + } \
> +} while (/*CONSTCOND*/0)
> +
> /*
> * Tail queue access methods.
> */
I wonder whether these are worth having. Can you show the difference
they make in the next patch?
next prev parent reply other threads:[~2021-02-01 8:31 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-29 16:50 [PATCH 0/7] qcow2: compressed write cache Vladimir Sementsov-Ogievskiy
2021-01-29 16:50 ` [PATCH 1/7] qemu/queue: add some useful QLIST_ and QTAILQ_ macros Vladimir Sementsov-Ogievskiy
2021-02-01 8:29 ` Markus Armbruster [this message]
2021-02-01 8:34 ` Vladimir Sementsov-Ogievskiy
2021-02-10 17:07 ` Max Reitz
2021-01-29 16:50 ` [PATCH 2/7] block/qcow2: introduce cache for compressed writes Vladimir Sementsov-Ogievskiy
2021-02-10 17:07 ` Max Reitz
2021-02-11 12:49 ` Vladimir Sementsov-Ogievskiy
2021-02-18 15:04 ` Max Reitz
2021-01-29 16:50 ` [PATCH 3/7] block/qcow2: use compressed write cache Vladimir Sementsov-Ogievskiy
2021-02-10 17:11 ` Max Reitz
2021-02-11 12:53 ` Vladimir Sementsov-Ogievskiy
2021-02-18 16:02 ` Max Reitz
2021-01-29 16:50 ` [PATCH 4/7] simplebench: bench_one(): add slow_limit argument Vladimir Sementsov-Ogievskiy
2021-01-29 16:50 ` [PATCH 5/7] simplebench: bench_one(): support count=1 Vladimir Sementsov-Ogievskiy
2021-01-29 16:50 ` [PATCH 6/7] simplebench/bench-backup: add --compressed option Vladimir Sementsov-Ogievskiy
2021-01-29 16:50 ` [PATCH 7/7] simplebench/bench-backup: add target-cache argument Vladimir Sementsov-Ogievskiy
2021-01-29 17:30 ` [PATCH 0/7] qcow2: compressed write cache no-reply
2021-02-01 8:24 ` Vladimir Sementsov-Ogievskiy
2021-02-09 13:25 ` Max Reitz
2021-02-09 14:10 ` Vladimir Sementsov-Ogievskiy
2021-02-09 14:47 ` Max Reitz
2021-02-09 16:39 ` Vladimir Sementsov-Ogievskiy
2021-02-09 18:36 ` Vladimir Sementsov-Ogievskiy
2021-02-09 18:41 ` Denis V. Lunev
2021-02-09 18:51 ` Vladimir Sementsov-Ogievskiy
2021-02-10 10:00 ` Max Reitz
2021-02-10 10:10 ` Vladimir Sementsov-Ogievskiy
2021-02-09 16:52 ` Denis V. Lunev
2021-02-10 10:00 ` Max Reitz
2021-02-10 12:35 ` Kevin Wolf
2021-02-10 14:35 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9bcfaxd.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=den@openvz.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.