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: 482721 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B5BFC1401AB for ; Thu, 11 Jun 2015 01:08:08 +1000 (AEST) Received: from localhost ([::1]:40904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2hbq-0001Tl-Oa for incoming@patchwork.ozlabs.org; Wed, 10 Jun 2015 11:08:06 -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-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=d21Vo5oe3jhbJh+u8Jzk2INmnfyz7kU1VdLWF7GLJ3o=; b=QFbvGj4XgbT1zbvo8wbHeNy4VEqLFhScdveIm7aDHE1tjbZmK2dqxcWZAMhqpmZ1fI IcynkESoQmKi7dWn5HPIVYoSHLeTfdg+3hykjyrsq5rY0Uh+hnEkL5E3wstIQKPygppw y6FLEwr+wRFxGUvXXM6I8/+ULNmLrMUezAKe1nb8we+7WekVgm8gVTyW12SdO2IuDvle q9qxZ1osNOYfTArtvguEouNB8VuRXfNIk5jupPcgck89cmnLk8ALL6Wkb4/fErPILH+I yTpVd2CAQVgF35INScMxT6GDxFWqKALMSOgtNq1Hx598Qw8qeoIILn3yMNvu1q5NPHZE 9z4g== X-Gm-Message-State: ALoCoQn7dFvJl4R8D6kF4ht2FzOmeng8hH3UaJ8YUCngfOBTdXVnnv/5oBuzCCxWTIquLqxDVbO/ 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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,