From patchwork Sun May 31 18:34:28 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: 49271 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DA046214D3 for ; Sun, 31 May 2015 18:37:28 +0000 (UTC) Received: by wiam3 with SMTP id m3sf5934916wia.3 for ; Sun, 31 May 2015 11:37:28 -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=K1SCkDRgxN8iapahHd8923VbstMPyF/3fWB/pRH9LXlOHd5kkhOGKUVNAQKFWP3s4m pNUwxvhJu4s/Vn2pKv7SFmkkhM17T7Lk8fswzzJeaojAWyH39sgZK2NDxE40BiFmmEG4 nVBLjKWY061DVpCvB6oJ3/hNfRXBrAiloeQtcCcwnhQX1YitJid8j604HiQEFgD+acL/ T/qieDKIfSSJcz4t9W7pMInZDzANT9+XratdnoBalD56qYlb2HHw3zEiYxHO5kTi77ht LKJGG5mvxQAgbkCpEqD3/0NGDwyNq+J04L3Bu4sT75Ob/BOeuZuj8gFR+XwA5Rlflr0m n50A== X-Gm-Message-State: ALoCoQmYubHSbRETmxGAFJi5MY6xPmMilDUKq4VRXwpUSDcYOOWss4cjBtkaer+5Pgg8UtSpNMt7 X-Received: by 10.194.175.36 with SMTP id bx4mr17144723wjc.1.1433097447661; Sun, 31 May 2015 11:37:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.207.65 with SMTP id lu1ls508463lac.104.gmail; Sun, 31 May 2015 11:37:27 -0700 (PDT) X-Received: by 10.112.144.69 with SMTP id sk5mr17424659lbb.6.1433097447456; Sun, 31 May 2015 11:37:27 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id ds10si10306745lbc.133.2015.05.31.11.37.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 May 2015 11:37:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbuc2 with SMTP id uc2so72919089lbb.2 for ; Sun, 31 May 2015 11:37:27 -0700 (PDT) X-Received: by 10.152.21.136 with SMTP id v8mr17562833lae.19.1433097447030; Sun, 31 May 2015 11:37:27 -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 hn6csp1791269lbb; Sun, 31 May 2015 11:37:26 -0700 (PDT) X-Received: by 10.55.18.144 with SMTP id 16mr32330398qks.17.1433097445723; Sun, 31 May 2015 11:37:25 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 123si9083359qhv.14.2015.05.31.11.37.25 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 31 May 2015 11:37:25 -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]:42887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz86u-0000Nj-Qr for patch@linaro.org; Sun, 31 May 2015 14:37:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz84C-0004li-7Z for qemu-devel@nongnu.org; Sun, 31 May 2015 14:34:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yz849-00047v-2a for qemu-devel@nongnu.org; Sun, 31 May 2015 14:34:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz848-00047r-S3 for qemu-devel@nongnu.org; Sun, 31 May 2015 14:34:33 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 6AE57B6A26; Sun, 31 May 2015 18:34:32 +0000 (UTC) Received: from redhat.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t4VIYSdp019674; Sun, 31 May 2015 14:34:29 -0400 Date: Sun, 31 May 2015 20:34:28 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1433097192-8988-4-git-send-email-mst@redhat.com> References: <1433097192-8988-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1433097192-8988-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 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 03/57] 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.217.169 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)