[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 3/4] hw/scsi/scsi-generic: Use automatic AIO context lock
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 3/4] hw/scsi/scsi-generic: Use automatic AIO context lock |
Date: |
Tue, 5 Oct 2021 20:58:06 +0200 |
Use the automatic AIO context acquire/release in
scsi_command_complete().
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/scsi/scsi-generic.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 665baf900e4..08ef623c030 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -114,9 +114,9 @@ static void scsi_command_complete(void *opaque, int ret)
assert(r->req.aiocb != NULL);
r->req.aiocb = NULL;
- aio_context_acquire(blk_get_aio_context(s->conf.blk));
- scsi_command_complete_noio(r, ret);
- aio_context_release(blk_get_aio_context(s->conf.blk));
+ WITH_AIO_CONTEXT_ACQUIRE_GUARD(blk_get_aio_context(s->conf.blk)) {
+ scsi_command_complete_noio(r, ret);
+ }
}
static int execute_command(BlockBackend *blk,
--
2.31.1