* [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place
@ 2011-04-28 14:34 Amit Shah
2011-04-28 14:34 ` [Qemu-devel] [PATCH 2/2] atapi: Explain why we need a 'media not present' state Amit Shah
2011-04-29 10:57 ` [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place Kevin Wolf
0 siblings, 2 replies; 3+ messages in thread
From: Amit Shah @ 2011-04-28 14:34 UTC (permalink / raw)
To: Kevin Wolf; +Cc: Amit Shah, qemu list
Move misplaced comment for media_is_dvd()
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
hw/ide/atapi.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index 690a0ab..86b18d8 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -71,12 +71,12 @@ static void lba_to_msf(uint8_t *buf, int lba)
buf[2] = lba % 75;
}
-/* XXX: DVDs that could fit on a CD will be reported as a CD */
static inline int media_present(IDEState *s)
{
return (s->nb_sectors > 0);
}
+/* XXX: DVDs that could fit on a CD will be reported as a CD */
static inline int media_is_dvd(IDEState *s)
{
return (media_present(s) && s->nb_sectors > CD_MAX_SECTORS);
--
1.7.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH 2/2] atapi: Explain why we need a 'media not present' state
2011-04-28 14:34 [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place Amit Shah
@ 2011-04-28 14:34 ` Amit Shah
2011-04-29 10:57 ` [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Amit Shah @ 2011-04-28 14:34 UTC (permalink / raw)
To: Kevin Wolf; +Cc: Amit Shah, qemu list
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>
---
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.4.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place
2011-04-28 14:34 [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place Amit Shah
2011-04-28 14:34 ` [Qemu-devel] [PATCH 2/2] atapi: Explain why we need a 'media not present' state Amit Shah
@ 2011-04-29 10:57 ` Kevin Wolf
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2011-04-29 10:57 UTC (permalink / raw)
To: Amit Shah; +Cc: qemu list
Am 28.04.2011 16:34, schrieb Amit Shah:
> Move misplaced comment for media_is_dvd()
>
> Signed-off-by: Amit Shah <amit.shah@redhat.com>
Thanks, applied both to the block branch.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-04-29 10:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-28 14:34 [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place Amit Shah
2011-04-28 14:34 ` [Qemu-devel] [PATCH 2/2] atapi: Explain why we need a 'media not present' state Amit Shah
2011-04-29 10:57 ` [Qemu-devel] [PATCH 1/2] atapi: Move comment to proper place Kevin Wolf
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).