[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH RFC 10/16] virtio-scsi: Request BLK_PERM_AIO_CONTEXT
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH RFC 10/16] virtio-scsi: Request BLK_PERM_AIO_CONTEXT_CHANGE for dataplane |
Date: |
Tue, 21 Mar 2017 11:16:29 +0800 |
blk_set_aio_context is audited by perm API, so follow the protocol and
request for permission first.
Signed-off-by: Fam Zheng <address@hidden>
---
hw/scsi/virtio-scsi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 1dbc4bc..6a48356 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -811,6 +811,10 @@ static void virtio_scsi_hotplug(HotplugHandler
*hotplug_dev, DeviceState *dev,
return;
}
virtio_scsi_acquire(s);
+ if (!blk_request_perm(sd->conf.blk, BLK_PERM_AIO_CONTEXT_CHANGE,
errp)) {
+ virtio_scsi_release(s);
+ return;
+ }
blk_set_aio_context(sd->conf.blk, s->ctx);
virtio_scsi_release(s);
--
2.9.3
- [Qemu-devel] [PATCH RFC 00/16] block: Protect AIO context change with perm API, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 01/16] block: Define BLK_PERM_AIO_CONTEXT_CHANGE, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 02/16] block-backend: Add blk_request_perm, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 03/16] blockjob: Add BLK_PERM_AIO_CONTEXT_CHANGE shared perm on bs, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 04/16] block: Propagate BLK_PERM_AIO_CONTEXT_CHANGE down the graph, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 05/16] backup: Request BLK_PERM_AIO_CONTEXT_CHANGE on target, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 06/16] backup: Do initial aio context move of target via BB interface, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 07/16] mirror: Request aio context change permission on target, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 08/16] commit: Allow aio context change on s->base, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 09/16] mirror: Do initial aio context move of target via BB interface, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 10/16] virtio-scsi: Request BLK_PERM_AIO_CONTEXT_CHANGE for dataplane,
Fam Zheng <=
- [Qemu-devel] [PATCH RFC 11/16] virtio-blk: Request BLK_PERM_AIO_CONTEXT_CHANGE for dataplane, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 12/16] blk: fix aio context loss on media change, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 13/16] nbd: Allow BLK_PERM_AIO_CONTEXT_CHANGE on BB, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 14/16] block: Add perm assertion on blk_set_aio_context, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 15/16] mirror: Lazily request aio context change permission on target, Fam Zheng, 2017/03/20
- [Qemu-devel] [PATCH RFC 16/16] Revert "mirror: Request aio context change permission on target", Fam Zheng, 2017/03/20