From: Paolo Bonzini <pbonzini@redhat.com>
To: Thomas Schmitt <scdbackup@gmx.net>
Cc: kwolf@redhat.com, stefanha@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Do you have a use for a tester of virtio-scsi with CD drives ?
Date: Thu, 03 Nov 2011 10:36:31 +0100 [thread overview]
Message-ID: <4EB2609F.7000601@redhat.com> (raw)
In-Reply-To: <97461468821810@192.168.2.69>
On 11/03/2011 10:15 AM, Thomas Schmitt wrote:
> Which gives me something to work on. libburn does not take into
> respect the Block Descriptor of 8 bytes which sits between
> Mode Data Header and mode page.
> So it misinterpets the result and demands the wrong Allocation
> Length.
>
> This error is explainable by my reading of MMC-5 which prescribes
> in table 653:
> "Block Descriptor Length = 0"
> MMC-1 on the other hand has in Annex B.4.1 :
> "The Mode Parameter Block Descriptor does not apply to ATAPI
> devices, and the Block Descriptor Length in the Mode
> Parameter Header shall be set to 0."
>
> My thanks to qemu and the developers of its SCSI CD-ROM for showing
> me this misconception in libburn.
MMC-3 also has some text saying that for compatibility you can have
block descriptors.
> ------------------------------------------------------------------------
>
> If i do only -drive file=/dev/sr0,if=scsi,medium=cdrom i get
> one empty drive, obviously from hw/ide/atapi.c:cmd_mode_sense():
>
> MODE SENSE
> 5a 00 2a 00 00 00 00 00 1c 00
> From drive: 28b
> 00 22 70 00 00 00 00 00 2a 12 3b 00 71 60 29 00 02 c0 00 02
> 02 00 02 c0 00 00 00 00
>
> So i mistook the default DVD-ROM drive, which has no source data and
> thus is empty, for the CD-ROM drive which i expected from -drive if=scsi
> which would not be empty, but does not show up at all.
>
> The question remains, why the CD-ROM drive is missing if i do -drive
> but not -cdrom.
Ok, so we have something to test now. :)
> I will repeat my experiments with
> -drive file=/dev/sg2,if=scsi,media=cdrom -cdrom /dvdbuffer/pseudo_drive
>
> Maybe the presence of -cdrom cures the problems i had with passthrough.
> (The bug in libburn is not to blame for that. The passthrough drive did not
> deliver a block descriptor.)
Yes, otherwise it wouldn't be passthrough. :)
> ------------------------------------------------------------------------
>
>> Yeah, looks like all the
>>
>> case MODE_PAGE_R_W_ERROR: /* error recovery */
>> cpu_to_ube16(&buf[0], 16 + 6);
>> should have "- 2" instead of "+ 6".
>
> I came to the same conclusion.
Good.
> MMC-1 allows MODE SENSE(6), MMC-3 implicitely assumes MODE SENSE(10) only,
> MMC-5 prescribes to use MODE SENSE(10).
>
> MMC-2 has a list of required ATAPI commands. MODE SENSE(10) is listed.
> MODE SENSE(6) is not listed.
>
>
> I compared this with the SCSI counterpart of cmd_mode_sense():
> hw/scsi-disk.c:scsi_disk_emulate_mode_sense()
>
> It distinguishes between MODE_SENSE, which gets 4 bytes of header,
> and MODE_SENSE_10, which gets 8. This looks correct.
Yep. Seems easiest to just drop MODE SENSE(6) from ATAPI.
Paolo
next prev parent reply other threads:[~2011-11-03 9:36 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-01 17:27 [Qemu-devel] Do you have a use for a tester of virtio-scsi with CD drives ? Thomas Schmitt
2011-11-01 21:03 ` Thomas Schmitt
2011-11-02 11:25 ` Stefan Hajnoczi
2011-11-02 12:08 ` Paolo Bonzini
2011-11-02 16:26 ` Thomas Schmitt
2011-11-02 16:34 ` Paolo Bonzini
2011-11-02 18:05 ` Thomas Schmitt
2011-11-02 19:50 ` Paolo Bonzini
2011-11-02 21:22 ` Thomas Schmitt
2011-11-02 22:08 ` Thomas Schmitt
2011-11-02 22:16 ` [Qemu-devel] Compile error Frans de Boer
2011-11-02 22:19 ` Anthony Liguori
2011-11-02 22:31 ` Frans de Boer
2011-11-03 7:49 ` [Qemu-devel] Do you have a use for a tester of virtio-scsi with CD drives ? Paolo Bonzini
2011-11-03 9:15 ` Thomas Schmitt
2011-11-03 9:36 ` Paolo Bonzini [this message]
2011-11-03 13:10 ` Thomas Schmitt
2011-11-03 22:30 ` Thomas Schmitt
2011-11-04 9:18 ` Thomas Schmitt
2011-11-04 9:38 ` Paolo Bonzini
2011-11-04 11:09 ` Thomas Schmitt
2011-11-04 11:31 ` Paolo Bonzini
2011-11-04 13:03 ` Thomas Schmitt
2011-11-04 20:28 ` Thomas Schmitt
2011-11-05 8:33 ` Paolo Bonzini
2011-11-05 13:00 ` Thomas Schmitt
2011-11-05 14:37 ` Thomas Schmitt
2011-11-05 15:53 ` Paolo Bonzini
2011-11-05 16:38 ` Thomas Schmitt
2011-11-05 20:47 ` Thomas Schmitt
2011-11-06 8:17 ` Paolo Bonzini
2011-11-06 10:35 ` Thomas Schmitt
2011-11-06 20:14 ` Thomas Schmitt
2011-11-07 8:02 ` Paolo Bonzini
2011-11-07 10:04 ` Thomas Schmitt
2011-11-07 11:13 ` Paolo Bonzini
2011-11-07 11:24 ` Zhi Yong Wu
2011-11-07 11:29 ` Paolo Bonzini
2011-11-07 11:40 ` Zhi Yong Wu
2011-11-06 9:31 ` Thomas Schmitt
2011-11-04 13:26 ` Andreas Färber
2011-11-04 14:46 ` Thomas Schmitt
2011-11-07 8:48 ` Zhi Yong Wu
2011-11-02 15:15 ` Thomas Schmitt
2011-11-02 16:22 ` Paolo Bonzini
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=4EB2609F.7000601@redhat.com \
--to=pbonzini@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=scdbackup@gmx.net \
--cc=stefanha@gmail.com \
/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.