ide: cmd_exec_dev_diagnostic() always set error register to 0x01
authorDavid du Colombier <0intro@gmail.com>
Wed, 25 Dec 2013 14:17:43 +0000 (15:17 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 15 Jan 2014 19:34:17 +0000 (23:34 +0400)
This notably fix IDE CD probing on the Plan 9 operating system,
which rely on the error register set by the Execute Device
Diagnostic command to detect drive configurations.

Thanks to RĂ©mi Pommarel for reporting this issue.

Signed-off-by: David du Colombier <0intro@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/ide/core.c

index e1f4c33fb8760f460170c0efc5fbbffed92a2f70..7783d58291d5cff8a163218aae0a247d74b75c03 100644 (file)
@@ -1321,6 +1321,7 @@ static bool cmd_exec_dev_diagnostic(IDEState *s, uint8_t cmd)
         s->status = 0; /* ATAPI spec (v6) section 9.10 defines packet
                         * devices to return a clear status register
                         * with READY_STAT *not* set. */
+        s->error = 0x01;
     } else {
         s->status = READY_STAT | SEEK_STAT;
         /* The bits of the error register are not as usual for this command!