From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cornelia Huck Subject: [PATCH RFC v2 04/12] s390x/virtio-ccw: fix check for WRITE_FEAT Date: Tue, 25 Nov 2014 14:24:15 +0100 Message-ID: <1416921863-16523-5-git-send-email-cornelia.huck@de.ibm.com> References: <1416921863-16523-1-git-send-email-cornelia.huck@de.ibm.com> Cc: rusty@rustcorp.com.au, thuth@linux.vnet.ibm.com, mst@redhat.com, Cornelia Huck To: virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org, kvm@vger.kernel.org Return-path: Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:47242 "EHLO e06smtp11.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753136AbaKYNYe (ORCPT ); Tue, 25 Nov 2014 08:24:34 -0500 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 25 Nov 2014 13:24:32 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 5B5BC1B08061 for ; Tue, 25 Nov 2014 13:24:45 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sAPDOU7f44761108 for ; Tue, 25 Nov 2014 13:24:30 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sAPDOTq4003169 for ; Tue, 25 Nov 2014 06:24:30 -0700 In-Reply-To: <1416921863-16523-1-git-send-email-cornelia.huck@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: We need to check guest feature size, not host feature size to find out whether we should call virtio_set_features(). This check is possible now that vdev->guest_features is an array. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 2f52b82..62ec852 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -399,7 +399,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) features.index = ldub_phys(&address_space_memory, ccw.cda + sizeof(features.features)); features.features = ldl_le_phys(&address_space_memory, ccw.cda); - if (features.index < ARRAY_SIZE(dev->host_features)) { + if (features.index < ARRAY_SIZE(vdev->guest_features)) { virtio_set_features(vdev, features.index, features.features); } else { /* -- 1.7.9.5