From patchwork Tue Oct 7 14:40:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 397384 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B0A8214010F for ; Wed, 8 Oct 2014 05:06:09 +1100 (EST) Received: from localhost ([::1]:60240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbZ9D-0008MY-P9 for incoming@patchwork.ozlabs.org; Tue, 07 Oct 2014 14:06:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbZ7o-0006qo-Ou for qemu-devel@nongnu.org; Tue, 07 Oct 2014 14:04:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbZ7f-0001n8-MP for qemu-devel@nongnu.org; Tue, 07 Oct 2014 14:04:40 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:47274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbZ7d-0001mc-Ff for qemu-devel@nongnu.org; Tue, 07 Oct 2014 14:04:31 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 7 Oct 2014 19:03:02 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 7 Oct 2014 19:03:00 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9B81B41400A7 for ; Tue, 7 Oct 2014 16:30:37 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s97FRWW321430342 for ; Tue, 7 Oct 2014 15:30:39 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 s97EeFeB000888 for ; Tue, 7 Oct 2014 08:40:16 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-210.boeblingen.de.ibm.com [9.152.224.210]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s97EeC49000717; Tue, 7 Oct 2014 08:40:15 -0600 From: Cornelia Huck To: virtualization@lists.linux-foundation.org, qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Tue, 7 Oct 2014 16:40:00 +0200 Message-Id: <1412692807-12398-5-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1412692807-12398-1-git-send-email-cornelia.huck@de.ibm.com> References: <1412692807-12398-1-git-send-email-cornelia.huck@de.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14100718-2966-0000-0000-0000016152A8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.109 Cc: Cornelia Huck , rusty@rustcorp.com.au, thuth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH RFC 04/11] s390x/virtio-ccw: fix check for WRITE_FEAT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 8aa79a7..69add47 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 { /*