summaryrefslogtreecommitdiff
path: root/hw/scsi-disk.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2010-02-03 12:41:03 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-02-10 11:57:03 -0600
commit380f640f96c8ae5b257bd4dec9b27cecd9d7e683 (patch)
tree2ad3df0540aa3cc7d16e232986c0831b96b3501d /hw/scsi-disk.c
parent7ad7e3c3bf81a7c2bbd872430435db7a21f8f44f (diff)
downloadqemu-380f640f96c8ae5b257bd4dec9b27cecd9d7e683.zip
scsi: Generate BLOCK_IO_ERROR QMP event
Just call bdrv_mon_event() in the right place. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/scsi-disk.c')
-rw-r--r--hw/scsi-disk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index b34fbaa674..1285122092 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -182,16 +182,20 @@ static int scsi_handle_write_error(SCSIDiskReq *r, int error)
BlockInterfaceErrorAction action =
drive_get_on_error(s->qdev.dinfo->bdrv, 0);
- if (action == BLOCK_ERR_IGNORE)
+ if (action == BLOCK_ERR_IGNORE) {
+ bdrv_mon_event(s->qdev.dinfo->bdrv, BDRV_ACTION_IGNORE, 0);
return 0;
+ }
if ((error == ENOSPC && action == BLOCK_ERR_STOP_ENOSPC)
|| action == BLOCK_ERR_STOP_ANY) {
r->status |= SCSI_REQ_STATUS_RETRY;
vm_stop(0);
+ bdrv_mon_event(s->qdev.dinfo->bdrv, BDRV_ACTION_STOP, 0);
} else {
scsi_command_complete(r, CHECK_CONDITION,
HARDWARE_ERROR);
+ bdrv_mon_event(s->qdev.dinfo->bdrv, BDRV_ACTION_REPORT, 0);
}
return 1;