From patchwork Thu Jun 11 12:00:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 49766 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 6619520C81 for ; Thu, 11 Jun 2015 12:44:46 +0000 (UTC) Received: by wgme6 with SMTP id e6sf1583737wgm.3 for ; Thu, 11 Jun 2015 05:44:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:message-id:references :mime-version:content-type:content-disposition:in-reply-to: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=oJxI4jl456Gnt5OSHjLjZFzAsiYbYmgXcoXXj0Jo6NA=; b=YV8LkIgPlZkzoXHRS/Opcgd0P4/HdI0axgo36GgNhRUQ/5P+v5ffGBzQDWBv9klasi 75RQeZ9twZzSJj0g0VKKo0Etu9dTv7VU6y6Rjt4unoLGsM1HqByaP00Fo+dEdgyO3KIr IyLYOHaZ1aJxE9n2KW7VvDwnv3ppychNpJ2/494nWJnJdnYQxHY2iNg+B4DBmOdBe7o4 OH3OWUBi3AjGB8tGD8lfJSNByv8Sgyxxc82toXNdIjvAk+W1GVrxNhCMh48MSQH2qQCV 4VEH6N43EJU7X2GZz7SiYEg8azoMK9t5lETfQc9MZJUoFwh5U5r7t8iny5pfJS9w1qmg k7Zw== X-Gm-Message-State: ALoCoQnYUJzCdUHZ7Ux1OxSKgGYRT62gqE7O/GUAlI2mFLFprU8n79GwYN8kerKEQpa1sd2dXTRR X-Received: by 10.180.221.203 with SMTP id qg11mr27269703wic.7.1434026685724; Thu, 11 Jun 2015 05:44:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.202 with SMTP id u10ls406244lau.6.gmail; Thu, 11 Jun 2015 05:44:45 -0700 (PDT) X-Received: by 10.152.3.130 with SMTP id c2mr9801048lac.81.1434026685521; Thu, 11 Jun 2015 05:44:45 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id lu5si536051lac.6.2015.06.11.05.44.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Jun 2015 05:44:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbbqq2 with SMTP id qq2so3418898lbb.3 for ; Thu, 11 Jun 2015 05:44:45 -0700 (PDT) X-Received: by 10.152.87.33 with SMTP id u1mr9892850laz.35.1434026685389; Thu, 11 Jun 2015 05:44:45 -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 hn6csp4016454lbb; Thu, 11 Jun 2015 05:44:44 -0700 (PDT) X-Received: by 10.55.43.38 with SMTP id r38mr18383158qkh.80.1434026683955; Thu, 11 Jun 2015 05:44:43 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id gt9si456188qcb.37.2015.06.11.05.44.43 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Jun 2015 05:44:43 -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]:45702 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z31OE-0007ic-W7 for patch@linaro.org; Thu, 11 Jun 2015 08:15:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z31AV-0001mY-3A for qemu-devel@nongnu.org; Thu, 11 Jun 2015 08:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z31AL-0007np-Al for qemu-devel@nongnu.org; Thu, 11 Jun 2015 08:01:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z31AK-0007kS-WA for qemu-devel@nongnu.org; Thu, 11 Jun 2015 08:01:01 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 74AD62BCD87; Thu, 11 Jun 2015 12:01:00 +0000 (UTC) Received: from redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t5BC0jfw009922; Thu, 11 Jun 2015 08:00:46 -0400 Date: Thu, 11 Jun 2015 14:00:45 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1434023714-30366-37-git-send-email-mst@redhat.com> References: <1434023714-30366-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1434023714-30366-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Cornelia Huck , Peter Maydell , Paolo Bonzini , Shannon Zhao , Shannon Zhao Subject: [Qemu-devel] [PULL 36/42] 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: mst@redhat.com 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.173 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 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-scsi.h | 13 ------------- hw/scsi/virtio-scsi.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 15 deletions(-) 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, 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(), };