[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/35] megasas: Implement DCMD_CLUSTER_RESET_LD
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 12/35] megasas: Implement DCMD_CLUSTER_RESET_LD |
Date: |
Fri, 31 Oct 2014 18:25:50 +0100 |
From: Hannes Reinecke <address@hidden>
Some implementations use DCMD_CLUSTER_RESET_LD to simulate
a device reset.
Signed-off-by: Hannes Reinecke <address@hidden>
[Compare against id, not lun. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/megasas.c | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index ed4cc1b..dcfef63 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -1416,9 +1416,23 @@ static int megasas_ctrl_shutdown(MegasasState *s,
MegasasCmd *cmd)
return MFI_STAT_OK;
}
+/* Some implementations use CLUSTER RESET LD to simulate a device reset */
static int megasas_cluster_reset_ld(MegasasState *s, MegasasCmd *cmd)
{
- return MFI_STAT_INVALID_DCMD;
+ uint16_t target_id;
+ int i;
+
+ /* mbox0 contains the device index */
+ target_id = le16_to_cpu(cmd->frame->dcmd.mbox[0]);
+ trace_megasas_dcmd_reset_ld(cmd->index, target_id);
+ for (i = 0; i < s->fw_cmds; i++) {
+ MegasasCmd *tmp_cmd = &s->frames[i];
+ if (tmp_cmd->req && tmp_cmd->req->dev->id == target_id) {
+ SCSIDevice *d = tmp_cmd->req->dev;
+ qdev_reset_all(&d->qdev);
+ }
+ }
+ return MFI_STAT_OK;
}
static int megasas_dcmd_set_properties(MegasasState *s, MegasasCmd *cmd)
--
1.8.3.1
- [Qemu-devel] [PULL 02/35] ui: Use the new ".mo-cflags" rule syntax for SDL_CFLAGS, (continued)
- [Qemu-devel] [PULL 02/35] ui: Use the new ".mo-cflags" rule syntax for SDL_CFLAGS, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 03/35] scsi: Rename scsi_*_length() to scsi_*_xfer(), add scsi_cdb_length(), Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 04/35] megasas: fixup MFI_DCMD_LD_LIST_QUERY, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 05/35] megasas: simplify trace event messages, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 06/35] megasas: fixup device mapping, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 07/35] megasas: add MegaRAID SAS 2108 emulation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 08/35] megasas: Fix typo in megasas_dcmd_ld_get_list(), Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 09/35] megasas: Decode register names, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 10/35] megasas: Clear unit attention on initial reset, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 11/35] megasas: Ignore duplicate init_firmware commands, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 12/35] megasas: Implement DCMD_CLUSTER_RESET_LD,
Paolo Bonzini <=
- [Qemu-devel] [PULL 13/35] megasas: Update queue logging, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 14/35] megasas: Rework frame queueing algorithm, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 15/35] megasas: Fixup MSI-X handling, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 16/35] -machine vmport=off: Allow disabling of VMWare ioport emulation, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 17/35] Add skip_dump flag to ignore memory region during dump, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 18/35] vl.c: Fix Coverity complaining for vmstate_dump_file, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 19/35] kvmvapic: patch_instruction fix, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 20/35] iscsi: Refuse to open as writable if the LUN is write protected, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 21/35] virtio-scsi: Fix memory leak when realize failed, Paolo Bonzini, 2014/10/31
- [Qemu-devel] [PULL 22/35] scsi: devirtualize unrealize of SCSI devices, Paolo Bonzini, 2014/10/31