All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH for-4.0 0/6] qemu/queue.h usage cleanup, improved QTAILQ API
Date: Fri,  7 Dec 2018 00:23:27 +0100	[thread overview]
Message-ID: <20181206232333.22408-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.

Paolo Bonzini (6):
  qemu/queue.h: do not access tqe_prev directly
  qemu/queue.h: leave head structs anonymous unless necessary
  qemu/queue.h: typedef QTAILQ heads
  qemu/queue.h: reimplement QTAILQ without pointer-to-pointers
  qemu/queue.h: simplify reverse access to QTAILQ
  checkpatch: warn about queue/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                    | 151 +++++++++++-------------
 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, 216 insertions(+), 247 deletions(-)

-- 
2.19.2

             reply	other threads:[~2018-12-06 23:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06 23:23 Paolo Bonzini [this message]
2018-12-06 23:23 ` [Qemu-devel] [PATCH 1/6] qemu/queue.h: do not access tqe_prev directly Paolo Bonzini
2018-12-07  7:14   ` Markus Armbruster
2018-12-07 10:14   ` Philippe Mathieu-Daudé
2018-12-06 23:23 ` [Qemu-devel] [PATCH 2/6] qemu/queue.h: leave head structs anonymous unless necessary Paolo Bonzini
2018-12-07  7:28   ` Markus Armbruster
2018-12-07 13:47     ` Paolo Bonzini
2018-12-06 23:23 ` [Qemu-devel] [PATCH 3/6] qemu/queue.h: typedef QTAILQ heads Paolo Bonzini
2018-12-07  7:30   ` Markus Armbruster
2018-12-07 10:15   ` Philippe Mathieu-Daudé
2018-12-06 23:23 ` [Qemu-devel] [PATCH 4/6] qemu/queue.h: reimplement QTAILQ without pointer-to-pointers Paolo Bonzini
2018-12-07  9:22   ` Markus Armbruster
2018-12-06 23:23 ` [Qemu-devel] [PATCH 5/6] qemu/queue.h: simplify reverse access to QTAILQ Paolo Bonzini
2018-12-06 23:23 ` [Qemu-devel] [PATCH 6/6] checkpatch: warn about queue/queue.h head structs that are not typedef-ed Paolo Bonzini
2018-12-07  9:02   ` Markus Armbruster
2018-12-07 13:49     ` 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=20181206232333.22408-1-pbonzini@redhat.com \
    --to=pbonzini@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 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.