qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] make windows notice media change
@ 2009-07-29 12:07 Gleb Natapov
  2009-07-29 13:50 ` [Qemu-devel] [PATCH v2] " Gleb Natapov
  0 siblings, 1 reply; 22+ messages in thread
From: Gleb Natapov @ 2009-07-29 12:07 UTC (permalink / raw)
  To: qemu-devel

Windows seems to be very stupid about cdrom media change. It polls
cdrom status and if status goes ready->media not present->ready
it assumes that media was changed. If "media not present" step doesn't
happen even if "medium may have changed" was seen it assumes media
haven't changed. Fake "media not present" step.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/hw/ide.c b/hw/ide.c
index 1e56786..5ae4a2b 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -1644,9 +1644,10 @@ static void ide_atapi_cmd(IDEState *s)
     }
     switch(s->io_buffer[0]) {
     case GPCMD_TEST_UNIT_READY:
-        if (bdrv_is_inserted(s->bs)) {
+        if (bdrv_is_inserted(s->bs) && !s->media_changed) {
             ide_atapi_cmd_ok(s);
         } else {
+            s->media_changed = 0;
             ide_atapi_cmd_error(s, SENSE_NOT_READY,
                                 ASC_MEDIUM_NOT_PRESENT);
         }
@@ -2106,7 +2107,7 @@ static void cdrom_change_cb(void *opaque)
 
     s->sense_key = SENSE_UNIT_ATTENTION;
     s->asc = ASC_MEDIUM_MAY_HAVE_CHANGED;
-
+    s->media_changed = 1;
     ide_set_irq(s);
 }
 
--
			Gleb.

^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-07-30 12:27 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 12:07 [Qemu-devel] [PATCH] make windows notice media change Gleb Natapov
2009-07-29 13:50 ` [Qemu-devel] [PATCH v2] " Gleb Natapov
2009-07-29 14:22   ` Avi Kivity
2009-07-29 14:21     ` Gleb Natapov
2009-07-29 14:44       ` Avi Kivity
2009-07-29 14:35   ` Filip Navara
2009-07-29 14:40     ` Gleb Natapov
2009-07-29 14:59       ` Stefano Stabellini
2009-07-29 19:11     ` Paul Brook
2009-07-29 19:18       ` Filip Navara
2009-07-29 19:24         ` Filip Navara
2009-07-29 19:34           ` Anthony Liguori
2009-07-29 19:52           ` Paul Brook
2009-07-29 19:56             ` Filip Navara
2009-07-29 20:05               ` Paul Brook
2009-07-29 20:14                 ` Gleb Natapov
2009-07-30 12:14                 ` Stefano Stabellini
2009-07-30 12:27                   ` Paul Brook
2009-07-29 19:33     ` Anthony Liguori
2009-07-29 19:44       ` [Qemu-devel] " Juan Quintela
2009-07-29 20:05         ` Anthony Liguori
2009-07-29 20:09           ` Juan Quintela

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).