From patchwork Thu Jan 19 15:56:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 136861 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 8A4FCB6EEA for ; Fri, 20 Jan 2012 03:05:50 +1100 (EST) Received: from localhost ([::1]:40376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnuUl-0001M5-9x for incoming@patchwork.ozlabs.org; Thu, 19 Jan 2012 11:05:47 -0500 Received: from eggs.gnu.org ([140.186.70.92]:48359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnuUD-0008Dw-JD for qemu-devel@nongnu.org; Thu, 19 Jan 2012 11:05:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnuM6-0007zG-AO for qemu-devel@nongnu.org; Thu, 19 Jan 2012 10:56:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:10849) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnuM6-0007ys-2G for qemu-devel@nongnu.org; Thu, 19 Jan 2012 10:56:50 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0JFumHE020856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 19 Jan 2012 10:56:48 -0500 Received: from localhost (ovpn-116-68.ams2.redhat.com [10.36.116.68]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0JFukLe001673; Thu, 19 Jan 2012 10:56:47 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 19 Jan 2012 13:56:30 -0200 Message-Id: <1326988591-27241-5-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1326988591-27241-1-git-send-email-lcapitulino@redhat.com> References: <1326988591-27241-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: aliguori@us.ibm.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com, agl@us.ibm.com, amit.shah@redhat.com, eblake@redhat.com Subject: [Qemu-devel] [PATCH 4/5] balloon: Rename QEMUBalloonStatus to QEMUBalloonInfo 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 Next commit will introduce the QEMUBalloonStats type, which can cause confusion with QEMUBalloonStatus. Also, QEMUBalloonInfo matches better with the BalloonInfo type, where the current balloon information is returned. Signed-off-by: Luiz Capitulino --- balloon.c | 18 +++++++++--------- balloon.h | 4 ++-- hw/virtio-balloon.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/balloon.c b/balloon.c index aa354f7..b32b487 100644 --- a/balloon.c +++ b/balloon.c @@ -32,13 +32,13 @@ #include "qmp-commands.h" static QEMUBalloonEvent *balloon_event_fn; -static QEMUBalloonStatus *balloon_stat_fn; +static QEMUBalloonInfo *balloon_info_fn; static void *balloon_opaque; int qemu_add_balloon_handler(QEMUBalloonEvent *event_func, - QEMUBalloonStatus *stat_func, void *opaque) + QEMUBalloonInfo *info_func, void *opaque) { - if (balloon_event_fn || balloon_stat_fn || balloon_opaque) { + if (balloon_event_fn || balloon_info_fn || balloon_opaque) { /* We're already registered one balloon handler. How many can * a guest really have? */ @@ -46,7 +46,7 @@ int qemu_add_balloon_handler(QEMUBalloonEvent *event_func, return -1; } balloon_event_fn = event_func; - balloon_stat_fn = stat_func; + balloon_info_fn = info_func; balloon_opaque = opaque; return 0; } @@ -57,7 +57,7 @@ void qemu_remove_balloon_handler(void *opaque) return; } balloon_event_fn = NULL; - balloon_stat_fn = NULL; + balloon_info_fn = NULL; balloon_opaque = NULL; } @@ -71,12 +71,12 @@ static int qemu_balloon(ram_addr_t target) return 1; } -static int qemu_balloon_status(BalloonInfo *info) +static int qemu_balloon_info(BalloonInfo *info) { - if (!balloon_stat_fn) { + if (!balloon_info_fn) { return 0; } - balloon_stat_fn(balloon_opaque, info); + balloon_info_fn(balloon_opaque, info); return 1; } @@ -91,7 +91,7 @@ BalloonInfo *qmp_query_balloon(Error **errp) info = g_malloc0(sizeof(*info)); - if (qemu_balloon_status(info) == 0) { + if (qemu_balloon_info(info) == 0) { error_set(errp, QERR_DEVICE_NOT_ACTIVE, "balloon"); qapi_free_BalloonInfo(info); return NULL; diff --git a/balloon.h b/balloon.h index 17fe300..a539354 100644 --- a/balloon.h +++ b/balloon.h @@ -17,10 +17,10 @@ #include "qapi-types.h" typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); -typedef void (QEMUBalloonStatus)(void *opaque, BalloonInfo *info); +typedef void (QEMUBalloonInfo)(void *opaque, BalloonInfo *info); int qemu_add_balloon_handler(QEMUBalloonEvent *event_func, - QEMUBalloonStatus *stat_func, void *opaque); + QEMUBalloonInfo *info_func, void *opaque); void qemu_remove_balloon_handler(void *opaque); #endif diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index ce9d2c9..4307f4c 100644 --- a/hw/virtio-balloon.c +++ b/hw/virtio-balloon.c @@ -156,7 +156,7 @@ static uint32_t virtio_balloon_get_features(VirtIODevice *vdev, uint32_t f) return f; } -static void virtio_balloon_stat(void *opaque, BalloonInfo *info) +static void virtio_balloon_info(void *opaque, BalloonInfo *info) { VirtIOBalloon *dev = opaque; @@ -236,7 +236,7 @@ VirtIODevice *virtio_balloon_init(DeviceState *dev) s->vdev.get_features = virtio_balloon_get_features; ret = qemu_add_balloon_handler(virtio_balloon_to_target, - virtio_balloon_stat, s); + virtio_balloon_info, s); if (ret < 0) { virtio_cleanup(&s->vdev); return NULL;