diff options
author | Fam Zheng <famz@redhat.com> | 2017-03-17 14:14:46 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-03-24 11:48:58 +0100 |
commit | 3d69f821616a578aeed569b3b56e157922819602 (patch) | |
tree | 968bc3f06efe266aeb350d49db04a18bffe52961 /include/hw/virtio | |
parent | ade9c1aac5292ff698fa550adebe794c37d86cc9 (diff) |
virtio-scsi: Make virtio_scsi_acquire/release public
They will be used in virtio-scsi-dataplane.c as well, so move them to
header.
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20170317061447.16243-2-famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/hw/virtio')
-rw-r--r-- | include/hw/virtio/virtio-scsi.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index f536f77e68..8ae0acaa1f 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -121,6 +121,20 @@ typedef struct VirtIOSCSIReq { } req; } VirtIOSCSIReq; +static inline void virtio_scsi_acquire(VirtIOSCSI *s) +{ + if (s->ctx) { + aio_context_acquire(s->ctx); + } +} + +static inline void virtio_scsi_release(VirtIOSCSI *s) +{ + if (s->ctx) { + aio_context_release(s->ctx); + } +} + void virtio_scsi_common_realize(DeviceState *dev, Error **errp, VirtIOHandleOutput ctrl, VirtIOHandleOutput evt, VirtIOHandleOutput cmd); |