From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39666) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uku2p-0003DM-8W for qemu-devel@nongnu.org; Fri, 07 Jun 2013 06:37:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uku2n-00037x-5v for qemu-devel@nongnu.org; Fri, 07 Jun 2013 06:37:19 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:38243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uku2m-000368-Sk for qemu-devel@nongnu.org; Fri, 07 Jun 2013 06:37:17 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Jun 2013 11:33:41 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0EC4517D8058 for ; Fri, 7 Jun 2013 11:38:32 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r57Ab2PR49872910 for ; Fri, 7 Jun 2013 10:37:02 GMT Received: from d06av12.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r57AbBZM001136 for ; Fri, 7 Jun 2013 04:37:12 -0600 From: Cornelia Huck Date: Fri, 7 Jun 2013 12:37:10 +0200 Message-Id: <1370601431-46381-2-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1370601431-46381-1-git-send-email-cornelia.huck@de.ibm.com> References: <1370601431-46381-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH RFC 1/2] KVM: s390: virtio-ccw: Handle command rejects. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: KVM , linux-s390 , qemu-devel , virtualization@lists.linux-foundation.org A command reject for a ccw may happen if we run on a host not supporting a certain feature. We want to be able to handle this as special case of command failure, so let's split this off from the generic -EIO error code. Signed-off-by: Cornelia Huck --- drivers/s390/kvm/virtio_ccw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c index 779dc51..d6c7aba 100644 --- a/drivers/s390/kvm/virtio_ccw.c +++ b/drivers/s390/kvm/virtio_ccw.c @@ -639,8 +639,15 @@ static void virtio_ccw_int_handler(struct ccw_device *cdev, (SCSW_STCTL_ALERT_STATUS | SCSW_STCTL_STATUS_PEND))) { /* OK */ } - if (irb_is_error(irb)) - vcdev->err = -EIO; /* XXX - use real error */ + if (irb_is_error(irb)) { + /* Command reject? */ + if ((scsw_dstat(&irb->scsw) & DEV_STAT_UNIT_CHECK) && + (irb->ecw[0] & SNS0_CMD_REJECT)) + vcdev->err = -EOPNOTSUPP; + else + /* Map everything else to -EIO. */ + vcdev->err = -EIO; + } if (vcdev->curr_io & activity) { switch (activity) { case VIRTIO_CCW_DOING_READ_FEAT: -- 1.8.1.6