From patchwork Mon Jun 1 12:22:27 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: 49326 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0EDFF218FC for ; Mon, 1 Jun 2015 12:23:43 +0000 (UTC) Received: by lbcue7 with SMTP id ue7sf33966758lbc.3 for ; Mon, 01 Jun 2015 05:23:41 -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=ZZqeEukU6FOgkryZ8XEzrMJ118iyYyj0nV2kdC+WUEc=; b=Quf3YUFUnr+u8vgMWt7cdAjjFTRkL+qYltq3BYuP1zr615+3bCyVvoHFr3B8sx5ZKD Ech08dw0vJm47Y5wKRwFSOot+2CJJQl4/K5YRyhroGWrnlMLlIRHnP/a153QkQPOioMK JEYJwSBEK+NYHzog3HrAzCLkZ4Urxx48Yw+pJQHTmIXj4rL2N8ygddy3wCfRIHBmaaXs Dqyigml0iGm7b9HUC1UhBle0Zn+WlYiZWPUXjA5If1tTNVbWL4Ab2G2HhC2bpqqIrYs6 zOpmBBY9w4Up3aZs/S/S+bFwDH8fyWN1ZwiSzi35VSEzXOSyPktNUZepAvD7aRwBLzFI vR9A== X-Gm-Message-State: ALoCoQkoMSj9TdwzIBWUgmXa1jDMhl+IcO4tIDdp50nMbfVGiRtICRZvYcdXOJMzOt4RYKHqubfz X-Received: by 10.112.142.170 with SMTP id rx10mr20495551lbb.12.1433161421928; Mon, 01 Jun 2015 05:23:41 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.1.105 with SMTP id 9ls22131lal.17.gmail; Mon, 01 Jun 2015 05:23:41 -0700 (PDT) X-Received: by 10.112.211.134 with SMTP id nc6mr20721428lbc.52.1433161421749; Mon, 01 Jun 2015 05:23:41 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id pz9si12179985lbb.92.2015.06.01.05.23.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 05:23:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labko7 with SMTP id ko7so96321741lab.2 for ; Mon, 01 Jun 2015 05:23:41 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr20847440lbc.86.1433161421518; Mon, 01 Jun 2015 05:23:41 -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 hn6csp2276624lbb; Mon, 1 Jun 2015 05:23:40 -0700 (PDT) X-Received: by 10.55.51.78 with SMTP id z75mr19170279qkz.101.1433161420084; Mon, 01 Jun 2015 05:23:40 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g1si12878869qcf.19.2015.06.01.05.23.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Jun 2015 05:23:40 -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]:51878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOkl-00069Q-4c for patch@linaro.org; Mon, 01 Jun 2015 08:23:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOjg-0005F6-UR for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:22:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzOje-0007HI-Ti for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:22:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42656) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOje-0007H8-Og for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:22:30 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 655763702D6; Mon, 1 Jun 2015 12:22:30 +0000 (UTC) Received: from redhat.com (ovpn-116-67.ams2.redhat.com [10.36.116.67]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t51CMRf0019183; Mon, 1 Jun 2015 08:22:28 -0400 Date: Mon, 1 Jun 2015 14:22:27 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1433161230-29421-2-git-send-email-mst@redhat.com> References: <1433161230-29421-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1433161230-29421-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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 v2 01/60] hw/virtio/virtio-balloon: move adding property to virtio_balloon_instance_init 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.215.54 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 This is in preparation for using alias property in virtio-balloon-pci and virtio-balloon-ccw. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck Reviewed-by: Paolo Bonzini --- hw/virtio/virtio-balloon.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index 484c3c3..cfff542 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -396,14 +396,6 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp) register_savevm(dev, "virtio-balloon", -1, 1, virtio_balloon_save, virtio_balloon_load, s); - - object_property_add(OBJECT(dev), "guest-stats", "guest statistics", - balloon_stats_get_all, NULL, NULL, s, NULL); - - object_property_add(OBJECT(dev), "guest-stats-polling-interval", "int", - balloon_stats_get_poll_interval, - balloon_stats_set_poll_interval, - NULL, s, NULL); } static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp) @@ -417,6 +409,19 @@ static void virtio_balloon_device_unrealize(DeviceState *dev, Error **errp) virtio_cleanup(vdev); } +static void virtio_balloon_instance_init(Object *obj) +{ + VirtIOBalloon *s = VIRTIO_BALLOON(obj); + + object_property_add(obj, "guest-stats", "guest statistics", + balloon_stats_get_all, NULL, NULL, s, NULL); + + object_property_add(obj, "guest-stats-polling-interval", "int", + balloon_stats_get_poll_interval, + balloon_stats_set_poll_interval, + NULL, s, NULL); +} + static Property virtio_balloon_properties[] = { DEFINE_PROP_END_OF_LIST(), }; @@ -441,6 +446,7 @@ static const TypeInfo virtio_balloon_info = { .name = TYPE_VIRTIO_BALLOON, .parent = TYPE_VIRTIO_DEVICE, .instance_size = sizeof(VirtIOBalloon), + .instance_init = virtio_balloon_instance_init, .class_init = virtio_balloon_class_init, };