From patchwork Mon May 11 09:34:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Zhao X-Patchwork-Id: 48230 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 242C421550 for ; Mon, 11 May 2015 09:36:43 +0000 (UTC) Received: by lamp14 with SMTP id p14sf40241413lam.3 for ; Mon, 11 May 2015 02:36:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references: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=VUHFDzeuEtzhkUD3Kf4wQVkHBh9JUkbgvpNIopVgvSQ=; b=iUF6uz1Ya32rT69oiLObD3yHLTQVVyIMAz1MVSOQuAfkxpcyf/hPQmt9uz9v6XwRxy nKS2nNhx5bxT1ENQDPmli5bsGlqPysR7pwA4wnIxFn4xBT7T/4A7fazzl98cHFpeFvy2 bZNKeSxMzvL0GSCpGMFTKeOqysF4q8WMfP0a42YTP/UEXx2rJkI9LqAdFY6BwkcmsBz+ pbnFyA8RKpRpbTqFtFcIfyWvZPpzlA0bsRnV2zXzpyibhhtG6uH+4sgL/ubZM52jR41q O0Kkmw+VFbWFpDx+h9REIWmhn4aqIke93zjQegSKNy7Qpczuum+P1MjSPToWSu7eA+K3 hKJA== X-Gm-Message-State: ALoCoQnH9sFRlcUzXg3+k9NKyE+kt/FBC43WKXaJoshOsLNGt5+O6CHvzul9nPicgoGUbb1ZfWjV X-Received: by 10.152.43.116 with SMTP id v20mr6988798lal.3.1431337001863; Mon, 11 May 2015 02:36:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.9 with SMTP id ky9ls497860lab.98.gmail; Mon, 11 May 2015 02:36:41 -0700 (PDT) X-Received: by 10.152.8.231 with SMTP id u7mr7294876laa.37.1431337001717; Mon, 11 May 2015 02:36:41 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id wx3si8034288lbb.142.2015.05.11.02.36.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 02:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbqq2 with SMTP id qq2so89698481lbb.3 for ; Mon, 11 May 2015 02:36:41 -0700 (PDT) X-Received: by 10.153.8.167 with SMTP id dl7mr7442822lad.86.1431337001635; Mon, 11 May 2015 02:36: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 hn6csp1400178lbb; Mon, 11 May 2015 02:36:40 -0700 (PDT) X-Received: by 10.140.147.143 with SMTP id 137mr12346831qht.7.1431337000079; Mon, 11 May 2015 02:36:40 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id z105si12474493qgz.67.2015.05.11.02.36.39 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 02:36: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]:36283 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrk8d-0008Fc-2P for patch@linaro.org; Mon, 11 May 2015 05:36:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrk6Z-0005fi-SX for qemu-devel@nongnu.org; Mon, 11 May 2015 05:34:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrk6W-0002fE-MP for qemu-devel@nongnu.org; Mon, 11 May 2015 05:34:31 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:34086) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrk6W-0002f9-H0 for qemu-devel@nongnu.org; Mon, 11 May 2015 05:34:28 -0400 Received: by pacyx8 with SMTP id yx8so105747871pac.1 for ; Mon, 11 May 2015 02:34:27 -0700 (PDT) X-Received: by 10.70.118.5 with SMTP id ki5mr17858864pdb.6.1431336867749; Mon, 11 May 2015 02:34:27 -0700 (PDT) Received: from localhost ([180.150.141.243]) by mx.google.com with ESMTPSA id td3sm12555474pab.46.2015.05.11.02.34.25 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 11 May 2015 02:34:26 -0700 (PDT) From: shannon.zhao@linaro.org To: qemu-devel@nongnu.org, peter.maydell@linaro.org, cornelia.huck@de.ibm.com, mst@redhat.com, pbonzini@redhat.com Date: Mon, 11 May 2015 17:34:07 +0800 Message-Id: <1431336847-4104-4-git-send-email-shannon.zhao@linaro.org> X-Mailer: git-send-email 1.9.5.msysgit.1 In-Reply-To: <1431336847-4104-1-git-send-email-shannon.zhao@linaro.org> References: <1431336847-4104-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.41 Cc: hangaohuai@huawei.com, peter.huangpeng@huawei.com, christoffer.dall@linaro.org, zhaoshenglong@huawei.com Subject: [Qemu-devel] [PATCH 3/3] 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: shannon.zhao@linaro.org 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.176 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 --- 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 430cc6f..426a097 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -897,44 +897,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)