From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLOH1-0006jy-B9 for qemu-devel@nongnu.org; Mon, 18 Jan 2016 23:52:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLOH0-0007O9-GG for qemu-devel@nongnu.org; Mon, 18 Jan 2016 23:52:07 -0500 From: John Snow Date: Mon, 18 Jan 2016 23:51:53 -0500 Message-Id: <1453179117-17909-2-git-send-email-jsnow@redhat.com> In-Reply-To: <1453179117-17909-1-git-send-email-jsnow@redhat.com> References: <1453179117-17909-1-git-send-email-jsnow@redhat.com> Subject: [Qemu-devel] [PATCH 1/5] ide: Prohibit RESET on IDE drives List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, John Snow , qemu-devel@nongnu.org, stefanha@redhat.com 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 --- hw/ide/core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/ide/core.c b/hw/ide/core.c index da3baab..ba33064 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -1876,9 +1876,12 @@ 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 to an ATAPI device while BSY and/or DRQ are set. */ + 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