qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH] send readcapacity10 when readcapacity16 failed


From: John Snow
Subject: Re: [Qemu-block] [PATCH] send readcapacity10 when readcapacity16 failed
Date: Tue, 5 Jan 2016 14:42:18 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 12/28/2015 10:32 PM, Zhu Lingshan wrote:
> When play with Dell MD3000 target, for sure it
> is a TYPE_DISK, but readcapacity16 would fail.
> Then we find that readcapacity10 succeeded. It
> looks like the target just support readcapacity10
> even through it is a TYPE_DISK or have some
> TYPE_ROM characteristics.
> 
> This patch can give a chance to send
> readcapacity16 when readcapacity10 failed.
> This patch is not harmful to original pathes
> 
> Signed-off-by: Zhu Lingshan <address@hidden>
> ---
>  block/iscsi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/iscsi.c b/block/iscsi.c
> index bd1f1bf..c8d167f 100644
> --- a/block/iscsi.c
> +++ b/block/iscsi.c
> @@ -1243,8 +1243,9 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun, 
> Error **errp)
>                      iscsilun->lbprz = !!rc16->lbprz;
>                      iscsilun->use_16_for_rw = (rc16->returned_lba > 
> 0xffffffff);
>                  }
> +                break;
>              }
> -            break;
> +        //fall through to try readcapacity10 instead
>          case TYPE_ROM:
>              task = iscsi_readcapacity10_sync(iscsilun->iscsi, iscsilun->lun, 
> 0, 0);
>              if (task != NULL && task->status == SCSI_STATUS_GOOD) {
> 

For the uninitiated, why does readcapacity16 fail?

My gut feeling is that this is a hack, because:

- Either readcapacity16 should work, or
- We shouldn't be choosing 10/16 based on the target type to begin with

but I don't know much about iSCSI, so maybe You, Paolo or Peter could
fill me in.

--js



reply via email to

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