[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/11] ide: Prohibit RESET on IDE drives
From: |
John Snow |
Subject: |
[Qemu-devel] [PULL 01/11] ide: Prohibit RESET on IDE drives |
Date: |
Wed, 10 Feb 2016 14:37:59 -0500 |
This command is meant for ATAPI devices only, prohibit acknowledging it with
a command aborted response when an IDE device is busy.
Signed-off-by: John Snow <address@hidden>
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
---
hw/ide/core.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 4c46453..88d5fab 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -1877,9 +1877,13 @@ void ide_exec_cmd(IDEBus *bus, uint32_t val)
return;
}
- /* Only DEVICE RESET is allowed while BSY or/and DRQ are set */
- if ((s->status & (BUSY_STAT|DRQ_STAT)) && val != WIN_DEVICE_RESET)
- return;
+ /* Only RESET is allowed while BSY and/or DRQ are set,
+ * and only to ATAPI devices. */
+ if (s->status & (BUSY_STAT|DRQ_STAT)) {
+ if (val != WIN_DEVICE_RESET || s->drive_kind != IDE_CD) {
+ return;
+ }
+ }
if (!ide_cmd_permitted(s, val)) {
ide_abort_command(s);
--
2.4.3
- [Qemu-devel] [PULL 00/11] Ide patches, John Snow, 2016/02/10
- [Qemu-devel] [PULL 01/11] ide: Prohibit RESET on IDE drives,
John Snow <=
- [Qemu-devel] [PULL 00/11] Ide patches, John Snow, 2016/02/10
- [Qemu-devel] [PULL 03/11] ide: move buffered DMA cancel to core, John Snow, 2016/02/10
- [Qemu-devel] [PULL 04/11] ide: replace blk_drain_all by blk_drain, John Snow, 2016/02/10
- [Qemu-devel] [PULL 02/11] ide: code motion, John Snow, 2016/02/10
- [Qemu-devel] [PULL 05/11] ide: Add silent DRQ cancellation, John Snow, 2016/02/10
- [Qemu-devel] [PULL 06/11] ide: fix device_reset to not ignore pending AIO, John Snow, 2016/02/10
- [Qemu-devel] [PULL 07/11] fdc: always compile-check debug prints, John Snow, 2016/02/10
- [Qemu-devel] [PULL 10/11] ahci: explicitly reject bad engine states on post_load, John Snow, 2016/02/10
- [Qemu-devel] [PULL 08/11] ahci: Do not unmap NULL addresses, John Snow, 2016/02/10