atapi: Report correct errors on guest eject request
commit88f2bb58ef97ca269b29fe92bb4834f5ddbcde80
authorAmit Shah <amit.shah@redhat.com>
Sat, 9 Apr 2011 10:24:39 +0000 (9 15:54 +0530)
committerKevin Wolf <kwolf@redhat.com>
Wed, 13 Apr 2011 10:06:41 +0000 (13 12:06 +0200)
treef60f03aaf86ba5caabf44d10055c63e30196fa89
parent8aa71917f7be78151cff50b850a25f26de614b13
atapi: Report correct errors on guest eject request

Table 629 of the MMC-5 spec mentions two different error conditions when
a CDROM eject is requested: a) while a disc is inserted and b) while a
disc is not inserted.

Ensure we return the appropriate error for the present condition of the
drive and disc status.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
hw/ide/core.c