From patchwork Sun May 31 18:34:24 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: 49272 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 4D216214D3 for ; Sun, 31 May 2015 18:37:52 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf29646129lbc.2 for ; Sun, 31 May 2015 11:37:50 -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=DUsJX/WZvFIeIKCy3Zf/+wV4jmCEFzoq9UmOzW3zDCk=; b=ElyWgdRpWig+kWYC9E9VOC4hnE5/zxOBGzEXJI8jj9tyEaK1K3PtIreexoJkpID2G7 xTW4ZpEPXl5cd1cTRyQQLuahVsreu8Q6X68L56dbF1o6+cgxmuQ4RzNIDUToPhxxT37J jY+Yh3UWNdJYNX2JvR/5H1r2ilGlrbUYT9GxEx4OptOqZXqppqhRok10urjNiSMoDwyg XHrg/cb9cNSbxdYutObqedJxfo7r5CzWMT6AMBbG4d3uX2VKmyWaj3pDvjz082S+tVVN uMG46+5vZvNvo/2Z76U13LFi6oxFwmw3htSUPrnB12mq3KDQfacsfuI1AbOHlfrBO4n6 MyMw== X-Gm-Message-State: ALoCoQmH+0Po2IyrpbH/ultOpgA678kmPRzDhT0GLikui65xVgEzaMGzUv2cFpNuZtAffU2UXEuG X-Received: by 10.112.118.162 with SMTP id kn2mr17370461lbb.22.1433097470722; Sun, 31 May 2015 11:37:50 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.182.228 with SMTP id eh4ls523726lac.45.gmail; Sun, 31 May 2015 11:37:50 -0700 (PDT) X-Received: by 10.152.170.165 with SMTP id an5mr17730262lac.100.1433097470541; Sun, 31 May 2015 11:37:50 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id 8si4092882laj.83.2015.05.31.11.37.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 May 2015 11:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbbqq2 with SMTP id qq2so72798454lbb.3 for ; Sun, 31 May 2015 11:37:50 -0700 (PDT) X-Received: by 10.152.4.72 with SMTP id i8mr17984534lai.32.1433097470022; Sun, 31 May 2015 11:37:50 -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 hn6csp1791430lbb; Sun, 31 May 2015 11:37:49 -0700 (PDT) X-Received: by 10.140.130.196 with SMTP id 187mr21094947qhc.12.1433097468738; Sun, 31 May 2015 11:37:48 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 82si11246390qkv.8.2015.05.31.11.37.48 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 31 May 2015 11:37:48 -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]:42889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz87H-0001Ga-Ox for patch@linaro.org; Sun, 31 May 2015 14:37:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz845-0004YR-E1 for qemu-devel@nongnu.org; Sun, 31 May 2015 14:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yz844-00047P-D3 for qemu-devel@nongnu.org; Sun, 31 May 2015 14:34:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz844-00047K-6K for qemu-devel@nongnu.org; Sun, 31 May 2015 14:34:28 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id BC14BB7A82; Sun, 31 May 2015 18:34:27 +0000 (UTC) Received: from redhat.com (ovpn-116-35.ams2.redhat.com [10.36.116.35]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t4VIYOHH020903; Sun, 31 May 2015 14:34:25 -0400 Date: Sun, 31 May 2015 20:34:24 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1433097192-8988-3-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.22 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 02/57] hw/virtio/virtio-pci: use alias property for virtio-balloon-pci 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.174 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/virtio/virtio-pci.c | 40 ++++++---------------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 867c9d1..c931790 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1207,32 +1207,6 @@ static const TypeInfo vhost_scsi_pci_info = { /* virtio-balloon-pci */ -static void balloon_pci_stats_get_all(Object *obj, struct Visitor *v, - void *opaque, const char *name, - Error **errp) -{ - VirtIOBalloonPCI *dev = opaque; - object_property_get(OBJECT(&dev->vdev), v, "guest-stats", errp); -} - -static void balloon_pci_stats_get_poll_interval(Object *obj, struct Visitor *v, - void *opaque, const char *name, - Error **errp) -{ - VirtIOBalloonPCI *dev = opaque; - object_property_get(OBJECT(&dev->vdev), v, "guest-stats-polling-interval", - errp); -} - -static void balloon_pci_stats_set_poll_interval(Object *obj, struct Visitor *v, - void *opaque, const char *name, - Error **errp) -{ - VirtIOBalloonPCI *dev = opaque; - object_property_set(OBJECT(&dev->vdev), v, "guest-stats-polling-interval", - errp); -} - static Property virtio_balloon_pci_properties[] = { DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0), DEFINE_PROP_END_OF_LIST(), @@ -1269,16 +1243,14 @@ static void virtio_balloon_pci_class_init(ObjectClass *klass, void *data) static void virtio_balloon_pci_instance_init(Object *obj) { VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(obj); + virtio_instance_init_common(obj, &dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON); - object_property_add(obj, "guest-stats", "guest statistics", - balloon_pci_stats_get_all, NULL, NULL, dev, - NULL); - - object_property_add(obj, "guest-stats-polling-interval", "int", - balloon_pci_stats_get_poll_interval, - balloon_pci_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 const TypeInfo virtio_balloon_pci_info = {