From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aH7UJ-0004eH-Lu for qemu-devel@nongnu.org; Thu, 07 Jan 2016 05:08:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aH7UF-0000PJ-ST for qemu-devel@nongnu.org; Thu, 07 Jan 2016 05:08:11 -0500 Sender: Paolo Bonzini References: <1451359934-9236-1-git-send-email-lszhu@suse.com> <568C1C9A.7090802@redhat.com> <568D556D.2090408@redhat.com> From: Paolo Bonzini Message-ID: <568E38FE.1080408@redhat.com> Date: Thu, 7 Jan 2016 11:07:58 +0100 MIME-Version: 1.0 In-Reply-To: <568D556D.2090408@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: John Snow , Zhu Lingshan Cc: Peter Lieven , qemu-block@nongnu.org, ronnie sahlberg , qemu-devel 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