提交 380f640f 编写于 作者: L Luiz Capitulino 提交者: Anthony Liguori

scsi: Generate BLOCK_IO_ERROR QMP event

Just call bdrv_mon_event() in the right place.
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 7ad7e3c3
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册