* [PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition
@ 2008-05-13 17:57 Pat Campbell
2008-05-14 9:18 ` Ian Jackson
0 siblings, 1 reply; 3+ messages in thread
From: Pat Campbell @ 2008-05-13 17:57 UTC (permalink / raw)
To: xen-devel
[-- Attachment #1: Type: text/plain, Size: 440 bytes --]
Patch sends a UNIT_ATTENTION(6), MEDIUM_MAY_HAVE_CHANGED(0x28) sense
when cdrom transitions from not ready to ready.
ATA Packet interface for CD-ROMS, SFF8020i.pdf. See state diagram Figure
12, page 82 and Table 44 -recommended Sense Key, ASC
With patch in place HVM win2008 server guest sees the CD/DVD contents
have changed when the media is switched.
Please apply to xen-unstable tip.
Signed-off-by: Pat Campbell <plc@novell.com>
[-- Attachment #2: qemu-unit-attention.patch --]
[-- Type: text/x-patch, Size: 994 bytes --]
diff -r af8da3f10449 tools/ioemu/hw/ide.c
--- a/tools/ioemu/hw/ide.c Tue May 13 11:46:39 2008 -0600
+++ b/tools/ioemu/hw/ide.c Tue May 13 06:42:09 2008 -0600
@@ -289,6 +289,7 @@
#define ASC_ILLEGAL_OPCODE 0x20
#define ASC_LOGICAL_BLOCK_OOR 0x21
#define ASC_INV_FIELD_IN_CMD_PACKET 0x24
+#define ASC_MEDIUM_MAY_HAVE_CHANGED 0x28
#define ASC_MEDIUM_NOT_PRESENT 0x3a
#define ASC_SAVING_PARAMETERS_NOT_SUPPORTED 0x39
@@ -1456,6 +1457,11 @@ static void ide_atapi_cmd(IDEState *s)
switch(s->io_buffer[0]) {
case GPCMD_TEST_UNIT_READY:
if (bdrv_is_inserted(s->bs)) {
+ if (s->is_cdrom && s->sense_key == SENSE_NOT_READY) {
+ ide_atapi_cmd_error(s, SENSE_UNIT_ATTENTION,
+ ASC_MEDIUM_MAY_HAVE_CHANGED);
+ break;
+ }
ide_atapi_cmd_ok(s);
} else {
ide_atapi_cmd_error(s, SENSE_NOT_READY,
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition
2008-05-13 17:57 [PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition Pat Campbell
@ 2008-05-14 9:18 ` Ian Jackson
2008-05-14 17:37 ` Pat Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Ian Jackson @ 2008-05-14 9:18 UTC (permalink / raw)
To: Pat Campbell; +Cc: xen-devel
Pat Campbell writes ("[Xen-devel][PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition"):
> Patch sends a UNIT_ATTENTION(6), MEDIUM_MAY_HAVE_CHANGED(0x28) sense
> when cdrom transitions from not ready to ready.
It seems to me that this patch should go upstream to qemu.
Is there some reason why not ?
If it should, please prepare a version of it against qemu CVS head and
submit it to the qemu list (qemu-devel@nongnu.org). I'll keep an eye
on it there too, as the qemu guys are quite busy and have a tendency
to overlook things so a reminder can be necessary.
in general it would be helpful if contributors helped keep to a
minimum the non-Xen-specific changes to ioemu. For larger patches
which need to vary substantially because of the existing differences
between upstream and ioemu, it's probably easier for someone who knows
those differences (eg, me) to do this. But I think that at least for
a small independent change like this it would be good for patch
submitters to talk to upstream as well as us.
I haven't double-checked the ATA spec but your patch looks reasonable
for xen-unstable, anyway.
Thanks,
Ian.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition
2008-05-14 9:18 ` Ian Jackson
@ 2008-05-14 17:37 ` Pat Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Pat Campbell @ 2008-05-14 17:37 UTC (permalink / raw)
To: Ian Jackson; +Cc: xen-devel
Ian Jackson wrote:
> Pat Campbell writes ("[Xen-devel][PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition"):
>
>> Patch sends a UNIT_ATTENTION(6), MEDIUM_MAY_HAVE_CHANGED(0x28) sense
>> when cdrom transitions from not ready to ready.
>>
>
> It seems to me that this patch should go upstream to qemu.
> Is there some reason why not ?
>
Submitted upstream to qemu this morning.
> If it should, please prepare a version of it against qemu CVS head and
> submit it to the qemu list (qemu-devel@nongnu.org). I'll keep an eye
> on it there too, as the qemu guys are quite busy and have a tendency
> to overlook things so a reminder can be necessary.
>
> in general it would be helpful if contributors helped keep to a
> minimum the non-Xen-specific changes to ioemu. For larger patches
> which need to vary substantially because of the existing differences
> between upstream and ioemu, it's probably easier for someone who knows
> those differences (eg, me) to do this. But I think that at least for
> a small independent change like this it would be good for patch
> submitters to talk to upstream as well as us.
>
> I haven't double-checked the ATA spec but your patch looks reasonable
> for xen-unstable, anyway.
>
> Thanks,
> Ian.
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-05-14 17:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-13 17:57 [PATCH] qemu: Send unit_attention on cd-rom not_ready to ready transition Pat Campbell
2008-05-14 9:18 ` Ian Jackson
2008-05-14 17:37 ` Pat Campbell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.