From patchwork Thu May 1 04:26:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenchao Xia X-Patchwork-Id: 344423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 981B5140115 for ; Thu, 1 May 2014 14:40:41 +1000 (EST) Received: from localhost ([::1]:60426 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfinX-0007r2-BM for incoming@patchwork.ozlabs.org; Thu, 01 May 2014 00:40:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49653) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WficO-0002SR-Jo for qemu-devel@nongnu.org; Thu, 01 May 2014 00:29:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WficF-0002Rn-Hd for qemu-devel@nongnu.org; Thu, 01 May 2014 00:29:08 -0400 Received: from mail-ig0-x234.google.com ([2607:f8b0:4001:c05::234]:64382) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WficF-0002Ri-AU for qemu-devel@nongnu.org; Thu, 01 May 2014 00:28:59 -0400 Received: by mail-ig0-f180.google.com with SMTP id c1so87925igq.13 for ; Wed, 30 Apr 2014 21:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AuKqaFsPbw5Kcy4UuHpma1rDrSMSgLhj2NtiJo9ushs=; b=cKrEhynNCcM/x8XJM380Oi2eOacFC777HgrslCbBzt40rmo1ayt8uiZginVWUQd6CE dJew/7dkOEuR2sf6l6X+IiiRIhnv5nxsNxvjqvCb30gRB+RIACIbmUjaHrsCqsANFU7j P0oeJfV1LrGyTwbaxb4y4SSik8ct6GSyy5JJqjfTOsA46vghD3Iu53mhWdk7hlaErgKA IOiyja2bODFryOakaqTNS+MDEfQhYcgB0Xi/hMUZY/rfdgtFMV4RNsAKbuo7Ocw4YBgA XFcW0QiJEUOwwTWMU88pBvWRVzXqsLVSrQvjT4LvNq9V9VXVE1tY+jrzGAVfwA8ASVK3 +eOg== X-Received: by 10.51.15.161 with SMTP id fp1mr462507igd.25.1398918538914; Wed, 30 Apr 2014 21:28:58 -0700 (PDT) Received: from localhost.localdomain.localdomain ([118.250.93.201]) by mx.google.com with ESMTPSA id ii7sm4626797igb.17.2014.04.30.21.28.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Apr 2014 21:28:58 -0700 (PDT) From: Wenchao Xia To: qemu-devel@nongnu.org Date: Wed, 30 Apr 2014 21:26:59 -0700 Message-Id: <1398918422-3019-26-git-send-email-wenchaoqemu@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1398918422-3019-1-git-send-email-wenchaoqemu@gmail.com> References: <1398918422-3019-1-git-send-email-wenchaoqemu@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::234 Cc: mdroth@linux.vnet.ibm.com, armbru@redhat.com, Wenchao Xia , lcapitulino@redhat.com Subject: [Qemu-devel] [PATCH V5 25/28] qapi event: convert BALLOON_CHANGE 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Wenchao Xia --- balloon.c | 13 ------------- hw/virtio/virtio-balloon.c | 6 ++++-- include/sysemu/balloon.h | 2 -- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/balloon.c b/balloon.c index e321f2c..b70da4f 100644 --- a/balloon.c +++ b/balloon.c @@ -81,19 +81,6 @@ static int qemu_balloon_status(BalloonInfo *info) return 1; } -void qemu_balloon_changed(int64_t actual) -{ - QObject *data; - - data = qobject_from_jsonf("{ 'actual': %" PRId64 " }", - actual); - - monitor_protocol_event(QEVENT_BALLOON_CHANGE, data); - - qobject_decref(data); -} - - BalloonInfo *qmp_query_balloon(Error **errp) { BalloonInfo *info; diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index a470a0b..6af21a7 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -24,6 +24,7 @@ #include "sysemu/kvm.h" #include "exec/address-spaces.h" #include "qapi/visitor.h" +#include "qapi-event.h" #if defined(__linux__) #include @@ -275,8 +276,9 @@ static void virtio_balloon_set_config(VirtIODevice *vdev, memcpy(&config, config_data, sizeof(struct virtio_balloon_config)); dev->actual = le32_to_cpu(config.actual); if (dev->actual != oldactual) { - qemu_balloon_changed(ram_size - - ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT)); + qapi_event_send_balloon_change(ram_size - + ((ram_addr_t) dev->actual << VIRTIO_BALLOON_PFN_SHIFT), + NULL); } } diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h index bd9d395..0345e01 100644 --- a/include/sysemu/balloon.h +++ b/include/sysemu/balloon.h @@ -24,6 +24,4 @@ int qemu_add_balloon_handler(QEMUBalloonEvent *event_func, QEMUBalloonStatus *stat_func, void *opaque); void qemu_remove_balloon_handler(void *opaque); -void qemu_balloon_changed(int64_t actual); - #endif