qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] scsi-disk: fix the block descriptor returne


From: Bernhard Kohl
Subject: Re: [Qemu-devel] [PATCH 4/4] scsi-disk: fix the block descriptor returned by the MODE SENSE command
Date: Fri, 27 Aug 2010 17:26:01 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100720 Fedora/3.0.6-1.fc12 Thunderbird/3.0.6

Am 16.08.2010 19:34, schrieb ext Kevin Wolf:

The patch itself looks okay. However, it made me wonder what this line
wants to tell us:

    if ((~dbd) & nb_sectors) {

Is it just me or doesn't this make any sense at all? dbd is a single
bit, 0x8 if set or 0x0 otherwise. nb_sectors is the number of sectors.
Can this operation have any meaningful result? I suppose it was meant to
be something like:

    if (!dbd && nb_sectors) {

Can you please check this and add a patch 5/4 if necessary?

For my opinion it is nonsense too. And it does not work. I tested it:

address@hidden ~ # sg_modes /dev/sdb -6 -v -H -H -p 0x3f
    inquiry cdb: 12 00 00 00 24 00
    QEMU      QEMU HARDDISK     0.13   peripheral_type: disk [0x0]
    mode sense (6) cdb: 1a 00 3f 00 fc 00
    mode sense (6): requested 252 bytes but got 220 bytes
Mode parameter header from MODE SENSE(6):
 00     1f 00 00 08
  Mode data length=32, medium type=0x00, WP=0, DpoFua=0, longlba=0
  Block descriptor length=8
> Direct access device block descriptors:
   Density code=0x0
 00     00 a0 00 00 00 00 02 00

>> page_code=0x8, page_control=0
 00     08 12 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 10     00 00 00 00
address@hidden ~ # sg_modes /dev/sdb -6 -v -H -H -p 0x3f -d
    inquiry cdb: 12 00 00 00 24 00
    QEMU      QEMU HARDDISK     0.13   peripheral_type: disk [0x0]
    mode sense (6) cdb: 1a 08 3f 00 fc 00
    mode sense (6): requested 252 bytes but got 220 bytes
Mode parameter header from MODE SENSE(6):
 00     1f 00 00 08
  Mode data length=32, medium type=0x00, WP=0, DpoFua=0, longlba=0
  Block descriptor length=8
> Direct access device block descriptors:
   Density code=0x0
 00     00 a0 00 00 00 00 02 00

>> page_code=0x8, page_control=0
 00     08 12 00 00 00 00 00 00  00 00 00 00 00 00 00 00
 10     00 00 00 00
address@hidden ~ #

I will add a patch 5/5 in v2 as you proposed.

Bernhard




reply via email to

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