From: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>
To: Alex Williamson <alex.williamson@hp.com>
Cc: Alexander Graf <agraf@suse.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] ide: fix ATAPI read drive structure command (v3)
Date: Tue, 3 Jun 2008 13:01:22 -0500 [thread overview]
Message-ID: <20080603180122.GA21838@tapir> (raw)
In-Reply-To: <1212502910.10496.7.camel@bling>
On Tue, Jun 03, 2008 at 08:21:50AM -0600, Alex Williamson wrote:
>
> On Tue, 2008-06-03 at 15:48 +0200, Alexander Graf wrote:
>
> > On Jun 3, 2008, at 12:12 AM, Alex Williamson wrote:
>
> > > @@ -1741,16 +1845,11 @@
> > > /*
> > > * the number of sectors from the media tells us which
> > > profile
> > > * to use as current. 0 means there is no media
> > > - *
> > > - * XXX: fails to detect correctly DVDs with less data
> > > burned
> > > - * than what a CD can hold
> > > */
> > > - if (s -> nb_sectors) {
> > > - if (s -> nb_sectors > CD_MAX_SECTORS)
> > > - cpu_to_ube16(buf + 6, MMC_PROFILE_DVD_ROM);
> > > - else
> > > - cpu_to_ube16(buf + 6, MMC_PROFILE_CD_ROM);
> > > - }
> > > + if (media_is_dvd(s))
> > > + cpu_to_ube16(buf + 6, MMC_PROFILE_DVD_ROM);
> > > + else if (media_is_cd(s))
> > > + cpu_to_ube16(buf + 6, MMC_PROFILE_CD_ROM);
> >
> >
> > After having looked at the spec and a real dvd rom output I got
> > uncertain if this is correct. Shouldn't capabilities provide the
> > capabilities of the drive and not the medium?
>
> Yes, I agree, this is a pretty weak test, however, that's a topic for a
> different patch. I'm not changing the existing logic here with this
> patch.
this is a "sorta" valid test for the GET_CONFIGURATION call as what is needed
here is the "active" profile, that is dependent on the type of media that is
loaded into a multi profile MMC device.
using the size of the media as an indication of what type it is, is definitely
weak and likely to fail on edge cases (as indicated by the comments) and
should be replaced for a better heuristic if there is one that can be used
instead.
Carlo
next prev parent reply other threads:[~2008-06-03 17: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 [this message]
2008-06-03 16:59 ` Anthony Liguori
2008-06-04 12:30 ` Alex Williamson
2008-06-04 14:35 ` Anthony Liguori
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=20080603180122.GA21838@tapir \
--to=carenas@sajinet.com.pe \
--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 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).