From: "Cédric Le Goater" <clg@redhat.com>
To: Rorie Reyes <rreyes@linux.ibm.com>,
qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: pbonzini@redhat.com, cohuck@redhat.com, pasic@linux.ibm.com,
jjherne@linux.ibm.com, borntraeger@linux.ibm.com,
alex.williamson@redhat.com, thuth@redhat.com,
akrowiak@linux.ibm.com
Subject: Re: [RFC PATCH v1] hw/vfio/ap: attribute constructor for cfg_chg_events_lock
Date: Thu, 12 Jun 2025 08:18:38 +0200 [thread overview]
Message-ID: <7db34f93-e373-4a27-a0e9-e76d6fe5e032@redhat.com> (raw)
In-Reply-To: <20250611211252.82107-1-rreyes@linux.ibm.com>
On 6/11/25 23:12, Rorie Reyes wrote:
> Created an attribute constructor for cfg_chg_events_lock for locking
> mechanism when storing event information for an AP configuration change
> event
>
> Fixes: fd03360215 ("Storing event information for an AP configuration change event")
> Signed-off-by: Rorie Reyes <rreyes@linux.ibm.com>
> ---
> hw/vfio/ap.c | 12 +++++-------
> 1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c
> index 874e0d1eaf..1df4438149 100644
> --- a/hw/vfio/ap.c
> +++ b/hw/vfio/ap.c
> @@ -52,6 +52,11 @@ static QTAILQ_HEAD(, APConfigChgEvent) cfg_chg_events =
>
> static QemuMutex cfg_chg_events_lock;
>
> +static void __attribute__((constructor)) vfio_ap_global_init(void)
> +{
> + qemu_mutex_init(&cfg_chg_events_lock);
> +}
> +
> OBJECT_DECLARE_SIMPLE_TYPE(VFIOAPDevice, VFIO_AP_DEVICE)
>
> static void vfio_ap_compute_needs_reset(VFIODevice *vdev)
> @@ -230,13 +235,6 @@ static void vfio_ap_realize(DeviceState *dev, Error **errp)
> VFIOAPDevice *vapdev = VFIO_AP_DEVICE(dev);
> VFIODevice *vbasedev = &vapdev->vdev;
>
> - static bool lock_initialized;
> -
> - if (!lock_initialized) {
> - qemu_mutex_init(&cfg_chg_events_lock);
> - lock_initialized = true;
> - }
> -
> if (!vfio_device_get_name(vbasedev, errp)) {
> return;
> }
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Applied to vfio-next.
Thanks,
C.
next prev parent reply other threads:[~2025-06-12 6:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-11 21:12 [RFC PATCH v1] hw/vfio/ap: attribute constructor for cfg_chg_events_lock Rorie Reyes
2025-06-12 4:44 ` Thomas Huth
2025-06-12 14:28 ` Rorie Reyes
2025-06-12 6:18 ` Cédric Le Goater [this message]
2025-06-12 14:29 ` Rorie Reyes
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=7db34f93-e373-4a27-a0e9-e76d6fe5e032@redhat.com \
--to=clg@redhat.com \
--cc=akrowiak@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=jjherne@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rreyes@linux.ibm.com \
--cc=thuth@redhat.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.