All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mahmoud Mandour <ma.mandourr@gmail.com>
To: qemu-devel@nongnu.org
Cc: Mahmoud Mandour <ma.mandourr@gmail.com>
Subject: [PATCH 0/9] Changing qemu_mutex_locks to lock guard macros
Date: Thu, 11 Mar 2021 05:15:29 +0200	[thread overview]
Message-ID: <20210311031538.5325-1-ma.mandourr@gmail.com> (raw)

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(-)

-- 
2.25.1



             reply	other threads:[~2021-03-11  9:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11  3:15 Mahmoud Mandour [this message]
2021-03-11  3:15 ` [PATCH 1/9] tpm: Changed a qemu_mutex_lock to QEMU_LOCK_GUARD Mahmoud Mandour
2021-03-11 10:04   ` Marc-André Lureau
2021-03-23  2:58   ` Stefan Berger
2021-03-11  3:15 ` [PATCH 2/9] block: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD Mahmoud Mandour
2021-03-12 10:23   ` Vladimir Sementsov-Ogievskiy
2021-03-13  5:51     ` Mahmoud Mandour
2021-03-15 14:08       ` Vladimir Sementsov-Ogievskiy
2021-03-16 13:29     ` Eric Blake
2021-03-11  3:15 ` [PATCH 3/9] char: Replaced a qemu_mutex_lock " Mahmoud Mandour
2021-03-11 10:05   ` Marc-André Lureau
2021-03-11  3:15 ` [PATCH 4/9] util: Replaced qemu_mutex_lock with QEMU_LOCK_GUARDs Mahmoud Mandour
2021-03-11  3:15 ` [PATCH 5/9] monitor: Replaced qemu_mutex_lock calls with QEMU_LOCK_GUARD Mahmoud Mandour
2021-03-11  9:50   ` Dr. David Alan Gilbert
2021-03-11  3:15 ` [PATCH 6/9] migration: " Mahmoud Mandour
2021-03-11  9:44   ` Dr. David Alan Gilbert
2021-03-15 18:01     ` Dr. David Alan Gilbert
2021-03-11  3:15 ` [PATCH 7/9] virtio-iommu: " Mahmoud Mandour
2021-03-11  3:15 ` [PATCH 8/9] hw/9pfs/9p-synth: Replaced qemu_mutex_lock " Mahmoud Mandour
2021-03-11  7:43   ` Greg Kurz
2021-03-11 10:49   ` Christian Schoenebeck
2021-03-11 11:52     ` Greg Kurz
2021-03-11 11:59       ` Christian Schoenebeck
2021-03-13  5:43         ` Mahmoud Mandour
2021-03-13  7:51           ` Greg Kurz
2021-03-15 16:07             ` Christian Schoenebeck
2021-03-15 20:31               ` Greg Kurz
2021-03-11  3:15 ` [PATCH 9/9] hw/hyperv/vmbus: replaced " Mahmoud Mandour

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=20210311031538.5325-1-ma.mandourr@gmail.com \
    --to=ma.mandourr@gmail.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.