From patchwork Wed Jun 10 15:04:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 49710 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5FD4B245D4 for ; Wed, 10 Jun 2015 15:08:40 +0000 (UTC) Received: by wifx6 with SMTP id x6sf13369261wif.1 for ; Wed, 10 Jun 2015 08:08:39 -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=d21Vo5oe3jhbJh+u8Jzk2INmnfyz7kU1VdLWF7GLJ3o=; b=hJYkHnwkB4C/S23u60Wiu2CCTgfjzYcP44lst4hzYJihWbA+08ebS7uaj02V5Nzgus AinEZObGGB6MMAKpEqScrMrlkk03w8pO8AO0kx8pZjfY7EbHnYfkru2hZ8ZlIKNgzbAP 8v37eiMKJpMlb+lt/loRdKhIxQroBf8CfEkc4UD2ujOY9AD2I2AfXl1VvcEFdu2vGHAw pYK31ynRfafCDc7KtwthMu0wT4a52JKf+QG9sxAIoP3S+AVzN9qkctOv7SO5c+O57Lyk 4z8mR5T94b8TPgUK2rJiK/kQ7p3uM8Eu1OuDLguBvbO3/YoiZnSKFh+yiBq2/qjgzHfm Up6w== X-Gm-Message-State: ALoCoQkVasHhzn+6ziFFCxxr3U3OabZyDss3Ulz2dZ3/YfvJ5IMktKRwGttTqwDnIqQxFJ9kD8m0 X-Received: by 10.194.179.42 with SMTP id dd10mr3364558wjc.7.1433948919678; Wed, 10 Jun 2015 08:08:39 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.9 with SMTP id ky9ls217382lab.98.gmail; Wed, 10 Jun 2015 08:08:39 -0700 (PDT) X-Received: by 10.152.22.99 with SMTP id c3mr4701055laf.32.1433948919517; Wed, 10 Jun 2015 08:08:39 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id ba16si9258180lab.113.2015.06.10.08.08.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2015 08:08:39 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbcmx3 with SMTP id mx3so30642269lbc.1 for ; Wed, 10 Jun 2015 08:08:39 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr4612534lbc.86.1433948919381; Wed, 10 Jun 2015 08:08:39 -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.108.230 with SMTP id hn6csp3396449lbb; Wed, 10 Jun 2015 08:08:38 -0700 (PDT) X-Received: by 10.55.19.12 with SMTP id d12mr7565614qkh.89.1433948917959; Wed, 10 Jun 2015 08:08:37 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w76si8906743qge.98.2015.06.10.08.08.37 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 10 Jun 2015 08:08:37 -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]:40904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hcK-0001Tl-TQ for patch@linaro.org; Wed, 10 Jun 2015 11:08:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hZg-0006ZK-DC for qemu-devel@nongnu.org; Wed, 10 Jun 2015 11:05:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2hZb-0006AM-NM for qemu-devel@nongnu.org; Wed, 10 Jun 2015 11:05:52 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hZb-00069q-Fu for qemu-devel@nongnu.org; Wed, 10 Jun 2015 11:05:47 -0400 Received: by payr10 with SMTP id r10so36720908pay.1 for ; Wed, 10 Jun 2015 08:05:46 -0700 (PDT) X-Received: by 10.66.122.5 with SMTP id lo5mr6449652pab.141.1433948746910; Wed, 10 Jun 2015 08:05:46 -0700 (PDT) Received: from localhost.localdomain ([167.160.116.93]) by mx.google.com with ESMTPSA id w8sm2687917pbt.45.2015.06.10.08.05.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Jun 2015 08:05:45 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Wed, 10 Jun 2015 23:04:32 +0800 Message-Id: <1433948676-14395-4-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1433948676-14395-1-git-send-email-shannon.zhao@linaro.org> References: <1433948676-14395-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.54 Cc: zhaoshenglong@huawei.com, shannon.zhao@linaro.org, mst@redhat.com Subject: [Qemu-devel] [PATCH v2 3/7] virtio-scsi: move qdev properties into virtio-scsi.c 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.171 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 As only one place in virtio-scsi.c uses DEFINE_VIRTIO_SCSI_PROPERTIES and DEFINE_VIRTIO_SCSI_FEATURES, there is no need to expose them. Inline them into virtio-scsi.c to avoid wrongly use. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Paolo Bonzini Acked-by: Cornelia Huck --- hw/scsi/virtio-scsi.c | 13 +++++++++++-- include/hw/virtio/virtio-scsi.h | 13 ------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index b0dee29..f7d3c7c 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -948,8 +948,17 @@ 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_UINT32("num_queues", VirtIOSCSI, parent_obj.conf.num_queues, 1), + DEFINE_PROP_UINT32("max_sectors", VirtIOSCSI, parent_obj.conf.max_sectors, + 0xFFFF), + DEFINE_PROP_UINT32("cmd_per_lun", VirtIOSCSI, parent_obj.conf.cmd_per_lun, + 128), + DEFINE_PROP_BIT("any_layout", VirtIOSCSI, host_features, + VIRTIO_F_ANY_LAYOUT, true), + DEFINE_PROP_BIT("hotplug", VirtIOSCSI, host_features, + VIRTIO_SCSI_F_HOTPLUG, true), + DEFINE_PROP_BIT("param_change", VirtIOSCSI, host_features, + VIRTIO_SCSI_F_CHANGE, true), DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h index b42e7f1..088fe9f 100644 --- a/include/hw/virtio/virtio-scsi.h +++ b/include/hw/virtio/virtio-scsi.h @@ -141,19 +141,6 @@ typedef struct VirtIOSCSIReq { } req; } VirtIOSCSIReq; -#define DEFINE_VIRTIO_SCSI_PROPERTIES(_state, _conf_field) \ - DEFINE_PROP_UINT32("num_queues", _state, _conf_field.num_queues, 1), \ - DEFINE_PROP_UINT32("max_sectors", _state, _conf_field.max_sectors, 0xFFFF),\ - DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128) - -#define DEFINE_VIRTIO_SCSI_FEATURES(_state, _feature_field) \ - DEFINE_PROP_BIT("any_layout", _state, _feature_field, \ - VIRTIO_F_ANY_LAYOUT, true), \ - DEFINE_PROP_BIT("hotplug", _state, _feature_field, VIRTIO_SCSI_F_HOTPLUG, \ - true), \ - DEFINE_PROP_BIT("param_change", _state, _feature_field, \ - VIRTIO_SCSI_F_CHANGE, true) - typedef void (*HandleOutput)(VirtIODevice *, VirtQueue *); void virtio_scsi_common_realize(DeviceState *dev, Error **errp,