From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com
Subject: [Qemu-devel] [PATCH for-4.0 v2 0/8] qemu/queue.h usage cleanup, improved QTAILQ API
Date: Mon, 10 Dec 2018 19:28:08 +0100 [thread overview]
Message-ID: <20181210182816.2014-1-pbonzini@redhat.com> (raw)
This series includes two changes that are a bit intertwined.
The main one is to reimplement QTAILQ in a way that simplifies
backwards walking of the list. The in-memory layout actually
stays the same, but the C description of it changes so that
(also thanks to typeof) you don't have to specify a name for
the "head" struct in QTAILQ_{LAST,PREV,FOREACH_REVERSE}.
This is done in patches 1, 4 and 5.
Once you do this, you actually almost never need to define
a named head struct. Therefore, the series also cleans up
other cases where the struct was given a name unnecessarily,
and ensures that those queue.h structs are given a typedef
and a camel case name, similar to all other structs in QEMU.
This is done in patches 2 and 3, and at the end of the series
we can add a checkpatch test for it in patch 6.
v1->v2: split out patches 2 and 5 [Markus for patch 5]
moved the other VFIO change from patch 3 to 4
Paolo Bonzini (8):
qemu/queue.h: do not access tqe_prev directly
vfio: make vfio_address_spaces static
qemu/queue.h: leave head structs anonymous unless necessary
qemu/queue.h: typedef QTAILQ heads
qemu/queue.h: remove Q_TAILQ_{HEAD,ENTRY}
qemu/queue.h: reimplement QTAILQ without pointer-to-pointers
qemu/queue.h: simplify reverse access to QTAILQ
checkpatch: warn about qemu/queue.h head structs that are not
typedef-ed
accel/kvm/kvm-all.c | 4 +-
block/gluster.c | 2 +-
block/mirror.c | 2 +-
block/qcow2-bitmap.c | 4 +-
block/qcow2.h | 2 +-
block/sheepdog.c | 6 +-
block/vhdx.h | 2 +-
blockdev.c | 4 +-
contrib/ivshmem-client/ivshmem-client.h | 4 +-
contrib/ivshmem-server/ivshmem-server.h | 5 +-
cpus-common.c | 2 +-
dump.c | 2 +-
exec.c | 5 +-
fsdev/qemu-fsdev.c | 2 +-
hw/block/nvme.h | 8 +-
hw/block/xen_disk.c | 6 +-
hw/core/qdev.c | 4 +-
hw/core/reset.c | 2 +-
hw/i386/xen/xen-mapcache.c | 2 +-
hw/ppc/spapr_iommu.c | 2 +-
hw/scsi/scsi-bus.c | 2 +-
hw/usb/ccid-card-emulated.c | 4 +-
hw/usb/combined-packet.c | 2 +-
hw/usb/dev-mtp.c | 4 +-
hw/usb/dev-network.c | 2 +-
hw/usb/hcd-ehci.c | 2 +-
hw/usb/hcd-ehci.h | 2 +-
hw/usb/hcd-uhci.c | 4 +-
hw/usb/xen-usb.c | 6 +-
hw/vfio/common.c | 4 +-
hw/watchdog/watchdog.c | 2 +-
hw/xen/xen_pvdev.c | 4 +-
include/exec/memory.h | 6 +-
include/hw/qdev-core.h | 2 +-
include/hw/usb.h | 2 +-
include/hw/vfio/vfio-common.h | 4 +-
include/hw/vfio/vfio-platform.h | 2 +-
include/net/net.h | 2 +-
include/qemu/option_int.h | 2 +-
include/qemu/queue.h | 153 +++++++++++-------------
include/qemu/rcu_queue.h | 45 +++----
include/qom/cpu.h | 9 +-
include/sysemu/kvm.h | 2 -
include/sysemu/memory_mapping.h | 2 +-
include/sysemu/rng.h | 2 +-
linux-user/elfload.c | 2 +-
memory.c | 19 ++-
memory_mapping.c | 2 +-
migration/block-dirty-bitmap.c | 2 +-
migration/block.c | 4 +-
migration/ram.c | 2 +-
monitor.c | 4 +-
net/filter.c | 2 +-
net/net.c | 2 +-
net/queue.c | 2 +-
net/slirp.c | 2 +-
qga/commands-posix.c | 2 +-
scripts/checkpatch.pl | 5 +
scripts/cocci-macro-file.h | 24 ++--
slirp/slirp.c | 2 +-
target/arm/kvm.c | 2 +-
target/i386/hax-mem.c | 2 +-
tcg/tcg.c | 2 +-
tcg/tcg.h | 6 +-
tests/libqos/malloc.c | 2 +-
tests/test-rcu-list.c | 2 +-
tests/test-vmstate.c | 8 +-
ui/console.c | 4 +-
ui/input.c | 14 ++-
util/qemu-option.c | 4 +-
vl.c | 2 +-
71 files changed, 217 insertions(+), 248 deletions(-)
--
2.19.2
next reply other threads:[~2018-12-10 18:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 18:28 Paolo Bonzini [this message]
2018-12-10 18:28 ` [Qemu-devel] [PATCH 1/8] qemu/queue.h: do not access tqe_prev directly Paolo Bonzini
2018-12-10 18:28 ` [Qemu-devel] [PATCH 2/8] vfio: make vfio_address_spaces static Paolo Bonzini
2018-12-10 21:23 ` Alex Williamson
2018-12-10 18:28 ` [Qemu-devel] [PATCH 3/8] qemu/queue.h: leave head structs anonymous unless necessary Paolo Bonzini
2018-12-10 18:28 ` [Qemu-devel] [PATCH 4/8] qemu/queue.h: typedef QTAILQ heads Paolo Bonzini
2018-12-10 18:28 ` [Qemu-devel] [PATCH 5/8] qemu/queue.h: remove Q_TAILQ_{HEAD, ENTRY} Paolo Bonzini
2018-12-10 18:28 ` [Qemu-devel] [PATCH 6/8] qemu/queue.h: reimplement QTAILQ without pointer-to-pointers Paolo Bonzini
2018-12-10 18:28 ` [Qemu-devel] [PATCH 7/8] qemu/queue.h: simplify reverse access to QTAILQ Paolo Bonzini
2019-02-04 11:45 ` [Qemu-devel] valgrind errors (was: [PATCH 7/8] qemu/queue.h: simplify reverse access to QTAILQ) Thomas Huth
2019-02-04 15:35 ` Paolo Bonzini
2018-12-10 18:28 ` [Qemu-devel] [PATCH 8/8] checkpatch: warn about qemu/queue.h head structs that are not typedef-ed Paolo Bonzini
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=20181210182816.2014-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).