From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40779) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpCbh-0003SD-5v for qemu-devel@nongnu.org; Thu, 22 Oct 2015 05:56:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpCbg-0000lT-Ep for qemu-devel@nongnu.org; Thu, 22 Oct 2015 05:56:25 -0400 References: <1445501858-18790-1-git-send-email-famz@redhat.com> <1445501858-18790-2-git-send-email-famz@redhat.com> <56289ED9.1040401@kamp.de> <5628A239.8030600@redhat.com> <20151022095147.GA3850@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <5628B2BF.9070903@redhat.com> Date: Thu, 22 Oct 2015 11:56:15 +0200 MIME-Version: 1.0 In-Reply-To: <20151022095147.GA3850@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] iscsi: Translate scsi sense into error code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , qemu-block@nongnu.org, Peter Lieven , qemu-devel@nongnu.org, Ronnie Sahlberg On 22/10/2015 11:51, Fam Zheng wrote: > > > > > > + switch (sense->key) { > > > + case SCSI_SENSE_NO_SENSE: > > > + return 0; > > > + break; > > > + case SCSI_SENSE_NOT_READY: > > > + return -EBUSY; > > > + break; > > > + case SCSI_SENSE_DATA_PROTECTION: > > > + return -EACCES; > > > > Probably EPERM, not EACCES. > > The comment of bdrv_write says -EACCES for read-only device, shoudn't this be > the same? Oh, then that's fine. I was looking at the write(2) man page.