qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: anthony@codemonkey.ws
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/6] atapi: Explain why we need a 'media not present' state
Date: Tue,  3 May 2011 13:08:23 +0200	[thread overview]
Message-ID: <1304420906-5776-4-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1304420906-5776-1-git-send-email-kwolf@redhat.com>

From: Amit Shah <amit.shah@redhat.com>

After the re-org of the atapi code, it might not be intuitive for a
reader of the code to understand why we're inserting a 'media not
present' state between cd changes.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 hw/ide/atapi.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 86b18d8..58febc0 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1106,7 +1106,13 @@ void ide_atapi_cmd(IDEState *s)
         ide_atapi_cmd_check_status(s);
         return;
     }
-
+    /*
+     * When a CD gets changed, we have to report an ejected state and
+     * then a loaded state to guests so that they detect tray
+     * open/close and media change events.  Guests that do not use
+     * GET_EVENT_STATUS_NOTIFICATION to detect such tray open/close
+     * states rely on this behavior.
+     */
     if (bdrv_is_inserted(s->bs) && s->cdrom_changed) {
         ide_atapi_cmd_error(s, SENSE_NOT_READY, ASC_MEDIUM_NOT_PRESENT);
 
-- 
1.7.2.3

  parent reply	other threads:[~2011-05-03 11:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 11:08 [Qemu-devel] [PULL 0/6] Block patches Kevin Wolf
2011-05-03 11:08 ` [Qemu-devel] [PATCH 1/6] qemu-img resize: Fix option parsing Kevin Wolf
2011-05-03 11:08 ` [Qemu-devel] [PATCH 2/6] atapi: Move comment to proper place Kevin Wolf
2011-05-03 11:08 ` Kevin Wolf [this message]
2011-05-03 11:08 ` [Qemu-devel] [PATCH 4/6] ide/atapi: fix set but unused Kevin Wolf
2011-05-03 11:08 ` [Qemu-devel] [PATCH 5/6] qemu-progress.c: printf isn't signal safe Kevin Wolf
2011-05-03 11:08 ` [Qemu-devel] [PATCH 6/6] NBD: Avoid leaking a couple of strings when the NBD device is closed Kevin Wolf
2011-05-03 12:44 ` [Qemu-devel] [PULL 0/6] Block patches Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304420906-5776-4-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).