From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aH7UV-00050O-28 for qemu-devel@nongnu.org; Thu, 07 Jan 2016 05:08:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aH7UR-0000Sf-1Z for qemu-devel@nongnu.org; Thu, 07 Jan 2016 05:08:22 -0500 Sender: Paolo Bonzini References: <1451359934-9236-1-git-send-email-lszhu@suse.com> From: Paolo Bonzini Message-ID: <568E390A.6070304@redhat.com> Date: Thu, 7 Jan 2016 11:08:10 +0100 MIME-Version: 1.0 In-Reply-To: <1451359934-9236-1-git-send-email-lszhu@suse.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] send readcapacity10 when readcapacity16 failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhu Lingshan , qemu-block@nongnu.org Cc: pl@kamp.de, qemu-devel@nongnu.org, ronniesahlberg@gmail.com On 29/12/2015 04:32, 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 > --- > 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) { > Queued, thanks. Paolo