From patchwork Mon Jun 16 15:40:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 360176 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 1E14114008B for ; Tue, 17 Jun 2014 01:42:16 +1000 (EST) Received: from localhost ([::1]:44897 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ30-0004ac-22 for incoming@patchwork.ozlabs.org; Mon, 16 Jun 2014 11:42:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35452) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ2I-0003Oz-Kw for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:41:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwZ2B-00031p-Sl for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:41:30 -0400 Received: from mail-pd0-f174.google.com ([209.85.192.174]:40428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwZ2B-00030i-Nb for qemu-devel@nongnu.org; Mon, 16 Jun 2014 11:41:23 -0400 Received: by mail-pd0-f174.google.com with SMTP id y10so4563232pdj.33 for ; Mon, 16 Jun 2014 08:41:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QABcFt7DE1iB93pTPDpPnV4CN+W5ParlCzkbVJxP4GU=; b=NpqdgPVVcSzlli6sT8BnQnti47kTJslGmEIKBqPB/HcgGRdxNdMWCTZEoXBhd6yG38 XQpRPTThM9HuvCkyPlLla1m+Jl3KIYzQtb/ot6C54d8jrFwoZsPt/3jXwfKVbkhtEZDU j1J1hQjVRtdRg29VdIScg4IV8BgJdjdJQ5FD6EBMP0wXoKyzxJJahD48NmGf8ZZP3IM9 KwsC8pwBWD44n/KgdSUV787p56QkSg3ZhpZntTXGKba9U6GZCtcFD3DirloTdr6JvMkh Ely6qOLXODfI7Kru0319WECGSMXtG7ubhbrpgE2zV1IRAwVAQ8xdmThqKTmeEyNq++K7 Xomg== X-Received: by 10.68.135.67 with SMTP id pq3mr5472445pbb.165.1402933282675; Mon, 16 Jun 2014 08:41:22 -0700 (PDT) Received: from localhost ([14.20.9.43]) by mx.google.com with ESMTPSA id id10sm19412489pbc.35.2014.06.16.08.41.19 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Jun 2014 08:41:21 -0700 (PDT) From: Ming Lei To: Peter Maydell , qemu-devel@nongnu.org Date: Mon, 16 Jun 2014 23:40:50 +0800 Message-Id: <1402933252-1079-3-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1402933252-1079-1-git-send-email-ming.lei@canonical.com> References: <1402933252-1079-1-git-send-email-ming.lei@canonical.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.192.174 Cc: Paolo Bonzini , Ming Lei Subject: [Qemu-devel] [PATCH 2/4] s390-virtio-bus: move common virtio properties to virtio s390 device class 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 The two common virtio features can be defined per bus, so move all into virtio-s390 class device to make code more clean. Suggested-by: Paolo Bonzini Signed-off-by: Ming Lei --- hw/s390x/s390-virtio-bus.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c index 9c71afa..ab9758e 100644 --- a/hw/s390x/s390-virtio-bus.c +++ b/hw/s390x/s390-virtio-bus.c @@ -526,18 +526,11 @@ static const TypeInfo s390_virtio_net = { .class_init = s390_virtio_net_class_init, }; -static Property s390_virtio_blk_properties[] = { - DEFINE_VIRTIO_BLK_PROPERTIES(VirtIOBlkS390, blk), - DEFINE_PROP_END_OF_LIST(), -}; - static void s390_virtio_blk_class_init(ObjectClass *klass, void *data) { - DeviceClass *dc = DEVICE_CLASS(klass); VirtIOS390DeviceClass *k = VIRTIO_S390_DEVICE_CLASS(klass); k->init = s390_virtio_blk_init; - dc->props = s390_virtio_blk_properties; } static const TypeInfo s390_virtio_blk = { @@ -571,7 +564,6 @@ static const TypeInfo s390_virtio_serial = { }; static Property s390_virtio_rng_properties[] = { - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features), DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORNGS390, vdev.conf), DEFINE_PROP_END_OF_LIST(), }; @@ -610,10 +602,16 @@ static void s390_virtio_busdev_reset(DeviceState *dev) virtio_reset(_dev->vdev); } +static Property virtio_s390_properties[] = { + DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features), + DEFINE_PROP_END_OF_LIST(), +}; + static void virtio_s390_device_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + dc->props = virtio_s390_properties; dc->init = s390_virtio_busdev_init; dc->bus_type = TYPE_S390_VIRTIO_BUS; dc->unplug = qdev_simple_unplug_cb; @@ -654,7 +652,6 @@ static const TypeInfo s390_virtio_scsi = { #ifdef CONFIG_VHOST_SCSI static Property s390_vhost_scsi_properties[] = { - DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features), DEFINE_VHOST_SCSI_PROPERTIES(VHostSCSIS390, vdev.parent_obj.conf), DEFINE_PROP_END_OF_LIST(), };