aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2012-04-12 12:44:14 +1000
committerAndreas Färber <afaerber@suse.de>2012-04-15 20:02:28 +0200
commit3cabba609de07e06b3dacf4f30403f6e9e293f2c (patch)
tree59ffa0d00779f5e9e35b8e934f5689686ce10e54
parentb1c7f725a3bc5fec87912e907066edd6b80b878c (diff)
pseries: Reset vscsi properly
Currently the PAPR vscsi implementation does not properly clear its table of request tags when the system is reset. This patch adds a reset hook to do so. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Andreas Färber <afaerber@suse.de>
-rw-r--r--hw/spapr_vscsi.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c
index 3530a38d9b..538e0b7938 100644
--- a/hw/spapr_vscsi.c
+++ b/hw/spapr_vscsi.c
@@ -893,16 +893,20 @@ static const struct SCSIBusInfo vscsi_scsi_info = {
.cancel = vscsi_request_cancelled
};
-static int spapr_vscsi_init(VIOsPAPRDevice *dev)
+static void spapr_vscsi_reset(VIOsPAPRDevice *dev)
{
VSCSIState *s = DO_UPCAST(VSCSIState, vdev, dev);
int i;
- /* Initialize qemu request tags */
memset(s->reqs, 0, sizeof(s->reqs));
for (i = 0; i < VSCSI_REQ_LIMIT; i++) {
s->reqs[i].qtag = i;
}
+}
+
+static int spapr_vscsi_init(VIOsPAPRDevice *dev)
+{
+ VSCSIState *s = DO_UPCAST(VSCSIState, vdev, dev);
dev->crq.SendFunc = vscsi_do_crq;
@@ -952,6 +956,7 @@ static void spapr_vscsi_class_init(ObjectClass *klass, void *data)
VIOsPAPRDeviceClass *k = VIO_SPAPR_DEVICE_CLASS(klass);
k->init = spapr_vscsi_init;
+ k->reset = spapr_vscsi_reset;
k->devnode = spapr_vscsi_devnode;
k->dt_name = "v-scsi";
k->dt_type = "vscsi";