aboutsummaryrefslogtreecommitdiff
path: root/hw/spapr_vscsi.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-04-18 17:11:14 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2011-05-26 12:14:14 +0200
commitcfdc1bb06ee4cd3a7e4aa0ebf14b00c0ce3a5e94 (patch)
tree3f7da29f2bb352933928902c461c33bde5026d85 /hw/spapr_vscsi.c
parentab9adc88c80186cfef29bda076363e20aa675241 (diff)
scsi: introduce SCSIBusOps
There are more operations than a SCSI bus can handle, besides completing commands. One example, which this series will introduce, is cleaning up after a request is cancelled. More long term, a "SCSI bus" can represent the LUNs attached to a target; in this case, while all commands will ultimately reach a logical unit, it is the target who is in charge of answering REPORT LUNs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Cc: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'hw/spapr_vscsi.c')
-rw-r--r--hw/spapr_vscsi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c
index 992833450c..c183008e42 100644
--- a/hw/spapr_vscsi.c
+++ b/hw/spapr_vscsi.c
@@ -907,6 +907,10 @@ static int vscsi_do_crq(struct VIOsPAPRDevice *dev, uint8_t *crq_data)
return 0;
}
+static const struct SCSIBusOps vscsi_scsi_ops = {
+ .complete = vscsi_command_complete
+};
+
static int spapr_vscsi_init(VIOsPAPRDevice *dev)
{
VSCSIState *s = DO_UPCAST(VSCSIState, vdev, dev);
@@ -923,7 +927,7 @@ static int spapr_vscsi_init(VIOsPAPRDevice *dev)
dev->crq.SendFunc = vscsi_do_crq;
scsi_bus_new(&s->bus, &dev->qdev, 1, VSCSI_REQ_LIMIT,
- vscsi_command_complete);
+ &vscsi_scsi_ops);
if (!dev->qdev.hotplugged) {
scsi_bus_legacy_handle_cmdline(&s->bus);
}