From patchwork Tue Apr 21 10:51:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47391 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 681972121F for ; Tue, 21 Apr 2015 10:52:31 +0000 (UTC) Received: by wgiv13 with SMTP id v13sf43982217wgi.3 for ; Tue, 21 Apr 2015 03:52:30 -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=88vZL19JC2p3TX+3BkMFgPLYFa8ReNBqVrL+acGMgQc=; b=OYVVZqKf4f/yRAy5oxGbYNUsLRFGvt+RbWQ9EFjrfZ9fsMT4KCFUhyVqHNc4AZsD+k pIyeWco/kfhVPTdD7eMHoikTubHQXnAR0tfqJW+Pq8c6kB6ir77Gb53y0VvCLJsS8oxZ UZtV8eerWFJKMnvtN1ZQQYB1M3CFR3t/t6h//TKKPqQsTF2ztEWK+F/k9izQLQXZ9Byi M5ARY5UgFegSC6zvIePRM/tPaMhWie2rnvfgbTZ9KpH/V61OrdxJMlfRrsaEUJj/ZfA7 JKzJUk1uBz+CsXOaU27p3U94FvqbqB3ZWs3zUlbtlfHdZB8IPFtmK7QEljIiUfWBr2VR FnRQ== X-Gm-Message-State: ALoCoQmcgnMZiRw38JjOvjZ7fEffN4fcdQgEHKUQShRpG2eEnA8rx2lpB8SjT5A4fUE7dbMFYixF X-Received: by 10.112.14.101 with SMTP id o5mr2207221lbc.3.1429613550449; Tue, 21 Apr 2015 03:52:30 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.196 with SMTP id u4ls31896lau.6.gmail; Tue, 21 Apr 2015 03:52:30 -0700 (PDT) X-Received: by 10.152.88.1 with SMTP id bc1mr19671952lab.79.1429613550236; Tue, 21 Apr 2015 03:52:30 -0700 (PDT) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com. [209.85.215.41]) by mx.google.com with ESMTPS id z7si1067057lal.43.2015.04.21.03.52.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Apr 2015 03:52:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.41 as permitted sender) client-ip=209.85.215.41; Received: by lagv1 with SMTP id v1so148089324lag.3 for ; Tue, 21 Apr 2015 03:52:30 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr19251373laj.72.1429613550123; Tue, 21 Apr 2015 03:52:30 -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 l1csp553987lbt; Tue, 21 Apr 2015 03:52:29 -0700 (PDT) X-Received: by 10.140.149.20 with SMTP id 20mr23651652qhv.38.1429613548764; Tue, 21 Apr 2015 03:52:28 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id f2si1460231qkh.53.2015.04.21.03.52.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 21 Apr 2015 03:52:28 -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]:57656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkVn1-0008V1-Kb for patch@linaro.org; Tue, 21 Apr 2015 06:52:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkVmH-0007lA-LA for qemu-devel@nongnu.org; Tue, 21 Apr 2015 06:51:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YkVmE-0007qC-EZ for qemu-devel@nongnu.org; Tue, 21 Apr 2015 06:51:41 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:35582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YkVmE-0007q7-32 for qemu-devel@nongnu.org; Tue, 21 Apr 2015 06:51:38 -0400 Received: by pdbqd1 with SMTP id qd1so238550262pdb.2 for ; Tue, 21 Apr 2015 03:51:37 -0700 (PDT) X-Received: by 10.68.251.227 with SMTP id zn3mr36500206pbc.157.1429613497504; Tue, 21 Apr 2015 03:51:37 -0700 (PDT) Received: from localhost ([167.160.116.4]) by mx.google.com with ESMTPSA id y13sm1700232pas.37.2015.04.21.03.51.34 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 21 Apr 2015 03:51:36 -0700 (PDT) From: shannon.zhao@linaro.org To: qemu-devel@nongnu.org, peter.maydell@linaro.org, cornelia.huck@de.ibm.com, mst@redhat.com, pbonzini@redhat.com, christoffer.dall@linaro.org Date: Tue, 21 Apr 2015 18:51:11 +0800 Message-Id: <1429613471-7944-3-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1429613471-7944-1-git-send-email-shannon.zhao@linaro.org> References: <1429613471-7944-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.192.173 Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH v3 2/2] 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.215.41 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 From: Shannon Zhao 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 b893e02..c8a78ba 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -622,7 +622,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 1252162..ef97fe9 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -1506,7 +1506,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 c9bea06..e242fef 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -631,6 +631,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); + + /* Firstly sync all virtio-scsi possible supported features */ + requested_features |= s->host_features; return requested_features; } @@ -945,6 +949,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 c6b99f9..5c173c4 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 {