From patchwork Mon Jun 1 12:22:33 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: 49328 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2A5A9218FC for ; Mon, 1 Jun 2015 12:28:11 +0000 (UTC) Received: by laboh3 with SMTP id oh3sf29058659lab.0 for ; Mon, 01 Jun 2015 05:28:09 -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=ZWmNTB3y3yZJOGCb+05vAlRkv5kufXEmF1zOLQasu0k=; b=B/0sn3J94OQo53D2Ek4eS4OhMZq1mojBBcvi+SQeYxCfH3O4049NCBwiHOLCOvHjKW 63t/htmjh0U2THqm0/IpE9j5r0fl5ZXg1OYgruZNa/G+EWYx7FFyRBNprl4bp0NLiNEx DsD/TQlBrw8vj0QpOm8QdOlPDV1rgOfDQFqoiMKf+Y8ceLWAcBM3Z90p7rPaFuinJ6Ls zUWksNDkjVHzAR7Yxj2V5zo7MARrKJQUlQVBTjBLn6hCz7Az3mPFa4bTz8nU9/f3YPE2 40G8AKBfy9dFhRP8N1DGSQ8BSukOBlCD9g42cPW2Fy6/IF4SDNUJmVfguPyF+ql0CDU+ E2Tw== X-Gm-Message-State: ALoCoQlvGx3I3vqjZqGic9hDm3NXyHTS/WR4CgzrGCnES8T51rRjHMoqZoytILI00UvpVvMRg5ke X-Received: by 10.112.29.39 with SMTP id g7mr20740559lbh.1.1433161689621; Mon, 01 Jun 2015 05:28:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.30.37 with SMTP id p5ls633474lah.9.gmail; Mon, 01 Jun 2015 05:28:09 -0700 (PDT) X-Received: by 10.112.125.166 with SMTP id mr6mr20118281lbb.83.1433161689446; Mon, 01 Jun 2015 05:28:09 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id j8si12207554lah.14.2015.06.01.05.28.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 05:28:09 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by labko7 with SMTP id ko7so96413940lab.2 for ; Mon, 01 Jun 2015 05:28:09 -0700 (PDT) X-Received: by 10.152.6.69 with SMTP id y5mr20449453lay.72.1433161689342; Mon, 01 Jun 2015 05:28:09 -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 hn6csp2279448lbb; Mon, 1 Jun 2015 05:28:08 -0700 (PDT) X-Received: by 10.55.33.99 with SMTP id h96mr36768104qkh.77.1433161687980; Mon, 01 Jun 2015 05:28:07 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id w19si9595362qkw.80.2015.06.01.05.28.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Jun 2015 05:28:07 -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]:51913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOp4-00056b-UP for patch@linaro.org; Mon, 01 Jun 2015 08:28:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOjq-0005Sy-EB for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:22:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzOjm-0007IZ-4H for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:22:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOjl-0007IT-Tl for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:22:38 -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 7FBE2C8365; Mon, 1 Jun 2015 12:22:37 +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 t51CMYCX019588; Mon, 1 Jun 2015 08:22:34 -0400 Date: Mon, 1 Jun 2015 14:22:33 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1433161230-29421-4-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: Peter Maydell , Alexander Graf , Christian Borntraeger , Shannon Zhao , Shannon Zhao , Cornelia Huck , Paolo Bonzini , Richard Henderson Subject: [Qemu-devel] [PULL v2 03/60] hw/s390x/virtio-ccw: use alias property for virtio-balloon-ccw 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.49 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 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/s390x/virtio-ccw.c | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index c96101a..f5f327c 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -896,44 +896,17 @@ static void virtio_ccw_balloon_realize(VirtioCcwDevice *ccw_dev, Error **errp) } } -static void balloon_ccw_stats_get_all(Object *obj, struct Visitor *v, - void *opaque, const char *name, - Error **errp) -{ - VirtIOBalloonCcw *dev = opaque; - object_property_get(OBJECT(&dev->vdev), v, "guest-stats", errp); -} - -static void balloon_ccw_stats_get_poll_interval(Object *obj, struct Visitor *v, - void *opaque, const char *name, - Error **errp) -{ - VirtIOBalloonCcw *dev = opaque; - object_property_get(OBJECT(&dev->vdev), v, "guest-stats-polling-interval", - errp); -} - -static void balloon_ccw_stats_set_poll_interval(Object *obj, struct Visitor *v, - void *opaque, const char *name, - Error **errp) -{ - VirtIOBalloonCcw *dev = opaque; - object_property_set(OBJECT(&dev->vdev), v, "guest-stats-polling-interval", - errp); -} - static void virtio_ccw_balloon_instance_init(Object *obj) { VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj); + virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON); - object_property_add(obj, "guest-stats", "guest statistics", - balloon_ccw_stats_get_all, NULL, NULL, dev, NULL); - - object_property_add(obj, "guest-stats-polling-interval", "int", - balloon_ccw_stats_get_poll_interval, - balloon_ccw_stats_set_poll_interval, - NULL, dev, NULL); + object_property_add_alias(obj, "guest-stats", OBJECT(&dev->vdev), + "guest-stats", &error_abort); + object_property_add_alias(obj, "guest-stats-polling-interval", + OBJECT(&dev->vdev), + "guest-stats-polling-interval", &error_abort); } static void virtio_ccw_scsi_realize(VirtioCcwDevice *ccw_dev, Error **errp)