aboutsummaryrefslogtreecommitdiff
path: root/hw/ide/atapi.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-10-25 12:53:39 +0200
committerKevin Wolf <kwolf@redhat.com>2011-11-11 14:02:57 +0100
commit2df0a3a3085adfde93505bc73c938310b0820c36 (patch)
treea177b261b39b611c0a056a180631128cf4765f64 /hw/ide/atapi.c
parent025ccaa7f9d2f54a79567599d3eb402100bed7a4 (diff)
atapi: implement eject requests
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/atapi.c')
-rw-r--r--hw/ide/atapi.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 90b6729692..1fed359ab1 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -516,9 +516,14 @@ static unsigned int event_status_media(IDEState *s,
/* Event notification descriptor */
event_code = MEC_NO_CHANGE;
- if (media_status != MS_TRAY_OPEN && s->events.new_media) {
- event_code = MEC_NEW_MEDIA;
- s->events.new_media = false;
+ if (media_status != MS_TRAY_OPEN) {
+ if (s->events.new_media) {
+ event_code = MEC_NEW_MEDIA;
+ s->events.new_media = false;
+ } else if (s->events.eject_request) {
+ event_code = MEC_EJECT_REQUESTED;
+ s->events.eject_request = false;
+ }
}
buf[4] = event_code;