From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIYAG-0004u5-Va for qemu-devel@nongnu.org; Mon, 11 Jan 2016 03:49:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIYAD-0002TR-Pq for qemu-devel@nongnu.org; Mon, 11 Jan 2016 03:49:24 -0500 Received: from mx-v6.kamp.de ([2a02:248:0:51::16]:43628 helo=mx01.kamp.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIYAD-0002Sp-HE for qemu-devel@nongnu.org; Mon, 11 Jan 2016 03:49:21 -0500 Message-ID: <56936C8B.3020305@kamp.de> Date: Mon, 11 Jan 2016 09:49:15 +0100 From: Peter Lieven MIME-Version: 1.0 References: <1451359934-9236-1-git-send-email-lszhu@suse.com> <568C1C9A.7090802@redhat.com> <568D556D.2090408@redhat.com> <568E38FE.1080408@redhat.com> In-Reply-To: <568E38FE.1080408@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] send readcapacity10 when readcapacity16 failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , John Snow , Zhu Lingshan Cc: qemu-block@nongnu.org, ronnie sahlberg , qemu-devel Am 07.01.2016 um 11:07 schrieb Paolo Bonzini: > > On 06/01/2016 18:57, John Snow wrote: >> Ronnie: Thanks for the explanation! >> >> Zhu: In light of this, can the patch be reworked slightly to explicitly >> check *why* READCAPACITY16 failed and only attempt the READCAPACITY10 as >> a fallback if it receives INVALID_OPCODE? >> >> If it fails for any other reason it's probably best to report the error >> and let QEMU decide what to do about it. > Any other failure probably would happen for READ CAPACITY(10) as well, so > it's okay to ignore it for READ CAPACITY(16). > > Zhu's patch matches what Linux does by default, it seems okay. The only > change needed is to retry READ CAPACITY(16) if there is a UNIT ATTENTION > sense: > > + if (task != NULL && task->status == SCSI_STATUS_CHECK_CONDITION > + && task->sense.key == SCSI_SENSE_UNIT_ATTENTION) { > + break; > + } > > Paolo Paolo, Ronnie, do you know what Readcapacity(10) returns if the target blocks count is greater than what can be described in 32bit? Anyway, is there a new version of this patch? I would also like to have a look before it is commited. Thanks, Peter