From patchwork Wed Apr 29 15:24:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 47729 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D03042121F for ; Wed, 29 Apr 2015 15:28:31 +0000 (UTC) Received: by wixv7 with SMTP id v7sf15108048wix.0 for ; Wed, 29 Apr 2015 08:28:31 -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=97RGC3OT8yvOE8Yd4ogcwsxw3zEDke/JzTKmVJ3hD8Q=; b=iPB7YBN6rhCQcovqCt7Fb1C/VEHnbifTb8BpkzIwmbbUn8XeKvt9jLJQ/no4Rejemf Ao4l5QwQNUOPpKZfnOTgpmTNeLKDj0GSJnX2djdABEx7VlYGjeUCTPsTF7GchNx0fE2Z s5Tb7DjAIZKvXuqIP1IIWoB+H0EfQrLeMnvm6+290FfuDuCq9T2ZCCj60kCKCvWhpHN4 oNs5dubsGMkHxpi3oonNPqNZ8fUl4psN4jLjQWHKb6lGh0BYxfS8w5vcJqeC66L3RiuB aYioRI+AQeud7npeRavRjY/Umvl+vRh23VwSK2YFEmq01gLxUgdR4YWyuplCQ9A7wxXc YWEQ== X-Gm-Message-State: ALoCoQkcAPj0Q3/YoDnC67NB4iDkMqi1RK8CDV3GS92ECYW/FPC3bE5+DqGhyVm5kpoWTzkng2ia X-Received: by 10.112.142.170 with SMTP id rx10mr13546608lbb.12.1430321311130; Wed, 29 Apr 2015 08:28:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.110 with SMTP id bf14ls228993lab.48.gmail; Wed, 29 Apr 2015 08:28:31 -0700 (PDT) X-Received: by 10.153.11.163 with SMTP id ej3mr19363498lad.105.1430321310989; Wed, 29 Apr 2015 08:28:30 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id h5si19602450laa.48.2015.04.29.08.28.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Apr 2015 08:28:30 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbqq2 with SMTP id qq2so23029597lbb.3 for ; Wed, 29 Apr 2015 08:28:30 -0700 (PDT) X-Received: by 10.152.236.40 with SMTP id ur8mr3332263lac.19.1430321310822; Wed, 29 Apr 2015 08:28: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 l1csp2575344lbt; Wed, 29 Apr 2015 08:28:30 -0700 (PDT) X-Received: by 10.140.232.144 with SMTP id d138mr18303249qhc.65.1430321307933; Wed, 29 Apr 2015 08:28:27 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [208.118.235.17]) by mx.google.com with ESMTPS id x193si39160qha.67.2015.04.29.08.28.27 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 29 Apr 2015 08:28:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; Received: from localhost ([::1]:39659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTuV-0002bC-6U for patch@linaro.org; Wed, 29 Apr 2015 11:28:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTrX-0006Ll-FU for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnTrT-0004XX-OQ for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:23 -0400 Received: from mail-pa0-f44.google.com ([209.85.220.44]:35921) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnTrT-0004XS-JQ for qemu-devel@nongnu.org; Wed, 29 Apr 2015 11:25:19 -0400 Received: by pabsx10 with SMTP id sx10so30740431pab.3 for ; Wed, 29 Apr 2015 08:25:19 -0700 (PDT) X-Received: by 10.66.252.3 with SMTP id zo3mr6104658pac.26.1430321119144; Wed, 29 Apr 2015 08:25:19 -0700 (PDT) Received: from localhost.localdomain ([180.150.153.56]) by mx.google.com with ESMTPSA id cu8sm25875045pad.1.2015.04.29.08.25.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Apr 2015 08:25:18 -0700 (PDT) From: Shannon Zhao To: qemu-devel@nongnu.org Date: Wed, 29 Apr 2015 23:24:05 +0800 Message-Id: <1430321049-11859-4-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1430321049-11859-1-git-send-email-shannon.zhao@linaro.org> References: <1430321049-11859-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.44 Cc: peter.maydell@linaro.org, hangaohuai@huawei.com, 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 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.178 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 --- 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 e242fef..166bb37 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,