From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpCXM-0001Z0-DP for qemu-devel@nongnu.org; Thu, 22 Oct 2015 05:51:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpCXL-0007zq-KN for qemu-devel@nongnu.org; Thu, 22 Oct 2015 05:51:56 -0400 Date: Thu, 22 Oct 2015 17:51:47 +0800 From: Fam Zheng Message-ID: <20151022095147.GA3850@ad.usersys.redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5628A239.8030600@redhat.com> 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: Paolo Bonzini Cc: Kevin Wolf , qemu-block@nongnu.org, Peter Lieven , qemu-devel@nongnu.org, Ronnie Sahlberg On Thu, 10/22 10:45, Paolo Bonzini wrote: > > > On 22/10/2015 10:31, Peter Lieven 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? Fam