summaryrefslogtreecommitdiffstats
path: root/hw/ide
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2016-02-10 13:29:38 -0500
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:41:57 -0600
commit0231690c6f03f8bbc8a82a2b630ab628236d7f74 (patch)
tree50278d7e6aa2a829d283b2136946eff4ee64e75e /hw/ide
parent08279e9e92123b04817f666e969315d0e6cd3724 (diff)
downloadhqemu-0231690c6f03f8bbc8a82a2b630ab628236d7f74.zip
hqemu-0231690c6f03f8bbc8a82a2b630ab628236d7f74.tar.gz
ide: Prohibit RESET on IDE drives
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 <jsnow@redhat.com> Reported-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1453225191-11871-2-git-send-email-jsnow@redhat.com
Diffstat (limited to 'hw/ide')
-rw-r--r--hw/ide/core.c10
1 files 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);
OpenPOWER on IntegriCloud