Skip to content

Changing qemu_mutex_locks to lock guard macros

Mahmoud Mandour qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9tpm: Changed a qemu_mutex_lock to QEMU_LOCK_GUARDbackends/tpm/tpm_emulator.c+3 -52 replies
2/9block: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARDblock/curl.c block/nbd.c+95 -1064 replies
3/9char: Replaced a qemu_mutex_lock with QEMU_LOCK_GUARDchardev/char.c+1 -21 reply
4/9util: Replaced qemu_mutex_lock with QEMU_LOCK_GUARDsutil/filemonitor-inotify.c util/vfio-helpers.c+18 -290 replies
5/9monitor: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARDmonitor/monitor.c monitor/qmp.c+26 -331 reply
6/9migration: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARDmigration/migration.c migration/ram.c+4 -82 replies
7/9virtio-iommu: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARDhw/virtio/virtio-iommu.c+36 -420 replies
8/9hw/9pfs/9p-synth: Replaced qemu_mutex_lock with QEMU_LOCK_GUARDhw/9pfs/9p-synth.c+4 -88 replies
9/9hw/hyperv/vmbus: replaced qemu_mutex_lock with QEMU_LOCK_GUARDhw/hyperv/vmbus.c+5 -80 replies

Reviews trailers per patch

6 of 9 patches have a Reviewed-by or Acked-by.

PatchGreg KurzDr. David Alan GilbertMarc-André LureauChristian SchoenebeckVladimir Sementsov-OgievskiyEric Blake
1/9R-b
2/9R-b A-b
3/9R-b
4/9
5/9R-b
6/9R-b
7/9
8/9A-b R-b
9/9

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v1 thread

Cover letter [PATCH 0/9] Changing qemu_mutex_locks to lock guard macros

Hello,

This is my first contribution to the qemu project, in which I attempt to replace some usages of qemu_mutex_lock calls and the respective qemu_mutex_unlock calls with QEMU_LOCK_GUARD macros.

As it is a matter of subjectivity on which we should base whether we would change qemu_mutex_lock/unlock with a lock guard, I tried as much as I could to only change it where beneficial to readibility and simplicity.

I tried to only change it where it would eliminate goto paths or if the span of locking/unlocking is so spacious that it's not immediately obvious that the particular calls to qemu_mutex_lock/unlock are a matching pair.

Mahmoud Mandour (9):
tpm: Changed a qemu_mutex_lock to QEMU_LOCK_GUARD
block: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD
char: Replaced a qemu_mutex_lock with QEMU_LOCK_GUARD
util: Replaced qemu_mutex_lock with QEMU_LOCK_GUARDs
monitor: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD
migration: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD
virtio-iommu: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD hw/9pfs/9p-synth: Replaced qemu_mutex_lock with QEMU_LOCK_GUARD hw/hyperv/vmbus: replaced qemu_mutex_lock with QEMU_LOCK_GUARD

 backends/tpm/tpm_emulator.c |   8 +-
 block/curl.c                |  13 +--
 block/nbd.c                 | 188 +++++++++++++++++-------------------
 chardev/char.c              |   3 +-
 hw/9pfs/9p-synth.c          |  12 +--
 hw/hyperv/vmbus.c           |  13 +--
 hw/virtio/virtio-iommu.c    |  78 +++++++--------
 migration/migration.c       |   6 +-
 migration/ram.c             |   6 +-
 monitor/monitor.c           |   8 +-
 monitor/qmp.c               |  51 +++++-----
 util/filemonitor-inotify.c  |  24 ++---
 util/vfio-helpers.c         |  23 ++---
 13 files changed, 192 insertions(+), 241 deletions(-)
Signature · 1 line
2.25.1