From: Anthony Liguori <aliguori@us.ibm.com>
To: Alex Williamson <alex.williamson@hp.com>
Cc: qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] ide: fix ATAPI read drive structure command (v3)
Date: Wed, 04 Jun 2008 09:35:39 -0500 [thread overview]
Message-ID: <4846A83B.2050000@us.ibm.com> (raw)
In-Reply-To: <1212582648.10496.134.camel@bling>
Alex Williamson wrote:
> On Tue, 2008-06-03 at 11:59 -0500, Anthony Liguori wrote:
>
>> Can you send this as an attachment or inlined as plain text?
>>
>
> Hmm, shows up as plain text in the archives, although there is a strange
> character in front of the patch title. Here it is again. Thanks,
>
> Alex
>
> Fix ATAPI read drive structure command
>
> Previous version ignored the allocation length parameter and read the
> format byte from the wrong location. Re-implement to support the full
> requirements for DVD-ROM and allow for easy extension later.
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
> --
>
> --- a/trunk/hw/ide.c 2008-06-02 16:37:12.000000000 -0600
> +++ b/trunk/hw/ide.c 2008-06-02 16:40:11.000000000 -0600
> @@ -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_INCOMPATIBLE_FORMAT 0x30
> #define ASC_MEDIUM_NOT_PRESENT 0x3a
> #define ASC_SAVING_PARAMETERS_NOT_SUPPORTED 0x39
>
> @@ -434,6 +435,22 @@
> int media_changed;
> } IDEState;
>
> +/* 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);
> +}
> +
> +static inline int media_is_dvd(IDEState *s)
> +{
> + return (media_present(s) && s->nb_sectors > CD_MAX_SECTORS);
> +}
> +
> +static inline int media_is_cd(IDEState *s)
> +{
> + return (media_present(s) && s->nb_sectors <= CD_MAX_SECTORS);
> +}
>
>
I think the automatic probing is good, but we should have a -drive
parameter that allows the cd type to explicitly be set to either CDROM
or DVD. This can be done in a follow-up patch though. I did some
testing with Windows and this patch seems to do the right thing.
Tested-by: Anthony Liguori <aliguori@us.ibm.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Regards,
Anthony Liguori
next prev parent reply other threads:[~2008-06-04 14:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-27 5:25 [Qemu-devel] [PATCH] ide: fix ATAPI read drive structure command Alex Williamson
2008-05-27 7:46 ` Alexander Graf
2008-05-28 19:48 ` Alex Williamson
2008-06-02 10:33 ` Alexander Graf
2008-06-02 14:58 ` Alex Williamson
2008-06-02 15:42 ` Alexander Graf
2008-06-02 22:12 ` [Qemu-devel] [PATCH] ide: fix ATAPI read drive structure command (v3) Alex Williamson
2008-06-02 22:45 ` Alex Williamson
2008-06-03 13:48 ` Alexander Graf
2008-06-03 14:21 ` Alex Williamson
2008-06-03 18:01 ` Carlo Marcelo Arenas Belon
2008-06-03 16:59 ` Anthony Liguori
2008-06-04 12:30 ` Alex Williamson
2008-06-04 14:35 ` Anthony Liguori [this message]
2008-06-04 14:49 ` Alex Williamson
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=4846A83B.2050000@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=agraf@suse.de \
--cc=alex.williamson@hp.com \
--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 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.