aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-01-23 09:08:54 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2013-01-23 09:08:54 -0600
commit177f7fc6884c47666f6c6eeca376a92432ccda38 (patch)
tree75f5ec98b1aa5c9c15b95033431e9a141cf59fd5 /hw
parent36ba58044e70a82b93e84b1f31076df847f23109 (diff)
parent0bf8264e2d2bd19c1eecf9bde0e59284ef47eabb (diff)
Merge remote-tracking branch 'bonzini/scsi-next' into staging
# By Peter Lieven (3) and others # Via Paolo Bonzini * bonzini/scsi-next: scsi: Drop useless null test in scsi_unit_attention() lsi: use qbus_reset_all to reset SCSI bus scsi: fix segfault with 0-byte disk iscsi: add support for iSCSI NOPs [v2] iscsi: partly avoid iovec linearization in iscsi_aio_writev iscsi: add iscsi_create support
Diffstat (limited to 'hw')
-rw-r--r--hw/lsi53c895a.c7
-rw-r--r--hw/scsi-bus.c2
-rw-r--r--hw/scsi-disk.c4
3 files changed, 4 insertions, 9 deletions
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 89c657fb00..860df328e5 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -1670,12 +1670,7 @@ static void lsi_reg_writeb(LSIState *s, int offset, uint8_t val)
}
if (val & LSI_SCNTL1_RST) {
if (!(s->sstat0 & LSI_SSTAT0_RST)) {
- BusChild *kid;
-
- QTAILQ_FOREACH(kid, &s->bus.qbus.children, sibling) {
- DeviceState *dev = kid->child;
- device_reset(dev);
- }
+ qbus_reset_all(&s->bus.qbus);
s->sstat0 |= LSI_SSTAT0_RST;
lsi_script_scsi_interrupt(s, LSI_SIST0_RST, 0);
}
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 267a942f76..a97f1cdc1c 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -282,7 +282,7 @@ static const struct SCSIReqOps reqops_invalid_opcode = {
static int32_t scsi_unit_attention(SCSIRequest *req, uint8_t *buf)
{
- if (req->dev && req->dev->unit_attention.key == UNIT_ATTENTION) {
+ if (req->dev->unit_attention.key == UNIT_ATTENTION) {
scsi_req_build_sense(req, req->dev->unit_attention);
} else if (req->bus->unit_attention.key == UNIT_ATTENTION) {
scsi_req_build_sense(req, req->bus->unit_attention);
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 96db9a73c7..28e75bbf5b 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -1680,7 +1680,7 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
bdrv_get_geometry(s->qdev.conf.bs, &nb_sectors);
if (!nb_sectors) {
scsi_check_condition(r, SENSE_CODE(LUN_NOT_READY));
- return -1;
+ return 0;
}
if ((req->cmd.buf[8] & 1) == 0 && req->cmd.lba) {
goto illegal_request;
@@ -1749,7 +1749,7 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf)
bdrv_get_geometry(s->qdev.conf.bs, &nb_sectors);
if (!nb_sectors) {
scsi_check_condition(r, SENSE_CODE(LUN_NOT_READY));
- return -1;
+ return 0;
}
if ((req->cmd.buf[14] & 1) == 0 && req->cmd.lba) {
goto illegal_request;