qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel][PATCH] Send unit_attention on cd-rom not_ready to ready


From: Ian Jackson
Subject: Re: [Qemu-devel][PATCH] Send unit_attention on cd-rom not_ready to ready transition
Date: Mon, 16 Jun 2008 18:03:03 +0100

Pat Campbell writes ("[Qemu-devel][PATCH] 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. 
...
> Patch applies to SVN revision 4456.

I have checked that this code compiles, and it seems to make sense
(although I haven't double-checked the SCSI specification to check
whether this is the right place to send that UNIT ATTENTION message).

I've also confirmed with Pat by email that it should be considered
signed off, so:

Acked-By: Ian Jackson <address@hidden>
Signed-off-by: Pat Campbell <address@hidden>
Signed-off-by: Ian Jackson <address@hidden>

Full disclosure: I have an interest in this in as much as I encouraged
Pat Campbell to submit this patch here as well as to xen-unstable.

> Index: hw/ide.c
> ===================================================================
> --- hw/ide.c  (revision 4456)
> +++ hw/ide.c  (working copy)
> @@ -351,6 +351,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
>  
> @@ -1385,6 +1386,11 @@
>      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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]