qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] block: Fix locking in media change monitor commands


From: Hanna Czenczek
Subject: Re: [PATCH 1/2] block: Fix locking in media change monitor commands
Date: Tue, 31 Oct 2023 12:54:48 +0100
User-agent: Mozilla Thunderbird

On 13.10.23 17:33, Kevin Wolf wrote:
blk_insert_bs() requires that the caller holds the AioContext lock for
the node to be inserted. Since commit c066e808e11, neglecting to do so
causes a crash when the child has to be moved to a different AioContext
to attach it to the BlockBackend.

This fixes qmp_blockdev_insert_anon_medium(), which is called for the
QMP commands 'blockdev-insert-medium' and 'blockdev-change-medium', to
correctly take the lock.

Cc: qemu-stable@nongnu.org
Fixes: https://issues.redhat.com/browse/RHEL-3922
Fixes: c066e808e11a5c181b625537b6c78e0de27a4801
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
  block/qapi-sysemu.c | 5 +++++
  1 file changed, 5 insertions(+)

Do we need to take the lock for the dev_ops tray callbacks, too?  I suppose not, and it also wouldn’t really matter in light of the lock being supposed to go away anyway, but still thought I should ask.

In any case, this change here is necessary, so:

Reviewed-by: Hanna Czenczek <hreitz@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]