From patchwork Fri Apr 17 12:13:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47287 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9B6902121F for ; Fri, 17 Apr 2015 13:17:53 +0000 (UTC) Received: by wghm4 with SMTP id m4sf24263552wgh.2 for ; Fri, 17 Apr 2015 06:17:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=FqERhfB+bxElB+oV0bnP9aCP4yn7WlqvA8z/32BiIZw=; b=YeUQkAOt5pN0rqX9LwKXsZUwWGmGTQC+YXUcnC5KmiJIcDjRX/Dhyl7H2GUjnDzI4L cnIDVR1FW98Sc8AIGrRiJkbomkpZ4g1Sl0DnxI6//vUW3rFTO3FRkfWwHMAEWYXkyvL1 id67WxGcE4WXW5KeR7eYp/N0aBpgUmE7ym3HpTyTiPrHJ5lrIfwvrUbSHvqraD0Oza8S AqIpEI2K1J2zJwPU0lLtaquq93WTfXduUHm+n1y+QsysDS3HeJU/u4VPYhChDIRG0ob3 bpTGnQ7y8bY/pdE8NKMFKhD3cogfW7/qL8ZLamioG8iq+EzyRmrWh37QtzYhX048jq7M i6/g== X-Gm-Message-State: ALoCoQm2EsZQX43QuHvKQZxlUlTKXqZ8lygwicati0SxoxRHKXaG7p2Bbr4k7vU6UhWnA/1uZWcr X-Received: by 10.112.122.39 with SMTP id lp7mr1435060lbb.5.1429276672907; Fri, 17 Apr 2015 06:17:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.3 with SMTP id bc3ls522472lab.22.gmail; Fri, 17 Apr 2015 06:17:52 -0700 (PDT) X-Received: by 10.112.129.132 with SMTP id nw4mr3603369lbb.122.1429276672371; Fri, 17 Apr 2015 06:17:52 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id u1si8784905lau.12.2015.04.17.06.17.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 06:17:52 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbcga7 with SMTP id ga7so82752509lbc.1 for ; Fri, 17 Apr 2015 06:17:52 -0700 (PDT) X-Received: by 10.112.8.101 with SMTP id q5mr3576166lba.19.1429276672247; Fri, 17 Apr 2015 06:17:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp3731277lbt; Fri, 17 Apr 2015 06:17:51 -0700 (PDT) X-Received: by 10.55.16.87 with SMTP id a84mr5413503qkh.86.1429276670953; Fri, 17 Apr 2015 06:17:50 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d191si11579540qka.74.2015.04.17.06.17.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Apr 2015 06:17:50 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:41376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj69V-0001am-So for patch@linaro.org; Fri, 17 Apr 2015 09:17:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5Av-0005d1-9v for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yj5Ap-0002GA-Al for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:15:13 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:33776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yj5Ap-0002FW-67 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 08:15:07 -0400 Received: by paboj16 with SMTP id oj16so123777407pab.0 for ; Fri, 17 Apr 2015 05:15:06 -0700 (PDT) X-Received: by 10.68.132.134 with SMTP id ou6mr4836217pbb.121.1429272906761; Fri, 17 Apr 2015 05:15:06 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id nb10sm10006492pdb.76.2015.04.17.05.15.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 05:15:05 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Fri, 17 Apr 2015 20:13:46 +0800 Message-Id: <1429272826-4145-5-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> References: <1429272826-4145-1-git-send-email-shannon.zhao@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.50 X-Mailman-Approved-At: Fri, 17 Apr 2015 09:13:08 -0400 Cc: peter.maydell@linaro.org, mst@redhat.com, peter.huangpeng@huawei.com, shannon.zhao@linaro.org, zhaoshenglong@huawei.com, pbonzini@redhat.com, christoffer.dall@linaro.org Subject: [Qemu-devel] [PATCH 4/4] virtio-scsi: Move DEFINE_VIRTIO_SCSI_FEATURES to virtio-scsi 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: shannon.zhao@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Move DEFINE_VIRTIO_SCSI_FEATURES to the backend virtio-scsi. The transports just sync the host features from backend. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/s390x/s390-virtio-bus.c | 1 - hw/s390x/virtio-ccw.c | 1 - hw/scsi/virtio-scsi.c | 5 +++++ hw/virtio/virtio-pci.c | 1 - include/hw/virtio/virtio-scsi.h | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 49c13e2..f77ac7a 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -632,7 +632,6 @@ static const TypeInfo virtio_s390_device_info = { static Property s390_virtio_scsi_properties[] = { DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features), - DEFINE_VIRTIO_SCSI_FEATURES(VirtIOS390Device, host_features), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index acd3844..0ea252c 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1513,7 +1513,6 @@ static const TypeInfo virtio_ccw_balloon = { static Property virtio_ccw_scsi_properties[] = { DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id), - DEFINE_VIRTIO_SCSI_FEATURES(VirtioCcwDevice, host_features[0]), DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_END_OF_LIST(), diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index da0cff8..719740e 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -627,6 +627,10 @@ static void virtio_scsi_set_config(VirtIODevice *vdev, static uint32_t virtio_scsi_get_features(VirtIODevice *vdev, uint32_t requested_features) { + VirtIOSCSI *s = VIRTIO_SCSI(vdev); + + /* First sync all virtio-scsi possible supported features */ + requested_features |= s->host_features; return requested_features; } @@ -941,6 +945,7 @@ static void virtio_scsi_device_unrealize(DeviceState *dev, Error **errp) static Property virtio_scsi_properties[] = { DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSI, parent_obj.conf), + DEFINE_VIRTIO_SCSI_FEATURES(VirtIOSCSI, host_features), DEFINE_PROP_END_OF_LIST(), }; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 772244e..7e2ac9e 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1078,7 +1078,6 @@ static Property virtio_scsi_pci_properties[] = { VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true), DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, DEV_NVECTORS_UNSPECIFIED), - DEFINE_VIRTIO_SCSI_FEATURES(VirtIOPCIProxy, host_features), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index f93b57d..b42e7f1 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -98,6 +98,7 @@ typedef struct VirtIOSCSI { bool dataplane_fenced; Error *blocker; Notifier migration_state_notifier; + uint32_t host_features; } VirtIOSCSI; typedef struct VirtIOSCSIReq {