From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vktcn-0007Nr-Pu for qemu-devel@nongnu.org; Mon, 25 Nov 2013 05:42:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vktch-0004IP-QE for qemu-devel@nongnu.org; Mon, 25 Nov 2013 05:42:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34468) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vktch-0004HI-Hv for qemu-devel@nongnu.org; Mon, 25 Nov 2013 05:42:35 -0500 Message-ID: <52932992.4090106@redhat.com> Date: Mon, 25 Nov 2013 11:42:26 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1385124001-3576-1-git-send-email-pbonzini@redhat.com> <1385124001-3576-13-git-send-email-pbonzini@redhat.com> <529327D2.6060303@kamp.de> In-Reply-To: <529327D2.6060303@kamp.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 12/19] block/iscsi: check WRITE SAME support differently depending on MAY_UNMAP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, qemu-devel@nongnu.org, stefanha@redhat.com Il 25/11/2013 11:34, Peter Lieven ha scritto: >> @@ -1012,6 +1018,14 @@ retry: >> } >> if (iTask.status != SCSI_STATUS_GOOD) { >> + if (iTask.status == SCSI_STATUS_CHECK_CONDITION && >> + iTask.task->sense.key == SCSI_SENSE_ILLEGAL_REQUEST && >> + iTask.task->sense.ascq == >> SCSI_SENSE_ASCQ_INVALID_OPERATION_CODE) { >> + /* WRITE SAME is not supported by the target */ >> + iscsilun->has_write_same = false; >> + return -ENOTSUP; >> + } >> + >> return -EIO; >> } >> @@ -1375,6 +1389,7 @@ static int iscsi_open(BlockDriverState *bs, >> QDict *options, int flags, >> } >> iscsilun->type = inq->periperal_device_type; >> + iscsilun->has_write_same = true; >> if ((ret = iscsi_readcapacity_sync(iscsilun)) != 0) { >> goto out; > > Maybe the naming has_write_same is misleading. It might be better to call > it try_write_same or has_write_same_failed with inverse logic. I was using the same names as block/raw-posix.c. I'm not sure I like the other names, but if the maintainers prefer them I'll gladly change them. Paolo