mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
hw/virtio: Introduce virtio_bh_new_guarded() helper
Introduce virtio_bh_new_guarded(), similar to qemu_bh_new_guarded() but using the transport memory guard, instead of the device one (there can only be one virtio device per virtio bus). Inspired-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20240409105537.18308-2-philmd@linaro.org>
This commit is contained in:
parent
927284d65b
commit
ec0504b989
2 changed files with 17 additions and 0 deletions
|
@ -4145,3 +4145,13 @@ static void virtio_register_types(void)
|
|||
}
|
||||
|
||||
type_init(virtio_register_types)
|
||||
|
||||
QEMUBH *virtio_bh_new_guarded_full(DeviceState *dev,
|
||||
QEMUBHFunc *cb, void *opaque,
|
||||
const char *name)
|
||||
{
|
||||
DeviceState *transport = qdev_get_parent_bus(dev)->parent;
|
||||
|
||||
return qemu_bh_new_full(cb, opaque, name,
|
||||
&transport->mem_reentrancy_guard);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue