From patchwork Tue Jul 26 09:08:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 106804 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 10A5BB6FF5 for ; Tue, 26 Jul 2011 19:08:49 +1000 (EST) Received: from localhost ([::1]:55212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qldd2-0005Vh-KL for incoming@patchwork.ozlabs.org; Tue, 26 Jul 2011 05:08:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]:57704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qldcr-0005L4-I3 for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:08:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qldcq-0006Px-72 for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:08:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qldcp-0006Pr-Uc for qemu-devel@nongnu.org; Tue, 26 Jul 2011 05:08:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6Q98Qmp004001 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 26 Jul 2011 05:08:26 -0400 Received: from localhost (dhcp193-45.pnq.redhat.com [10.65.193.45]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p6Q98PSN002784; Tue, 26 Jul 2011 05:08:25 -0400 From: Amit Shah To: qemu list Date: Tue, 26 Jul 2011 14:38:11 +0530 Message-Id: <2798b5e1747095592e3b83b3527ef91a78364c76.1311671108.git.amit.shah@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Amit Shah , jforbes@redhat.com, Markus Armbruster Subject: [Qemu-devel] [PATCH 1/7] balloon: Make functions, local vars static 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 balloon.h had function declarations for a couple of functions that are local to balloon.c. Make them static. Drop the 'qemu_' prefix for balloon.c-local variables, and make them static. Signed-off-by: Amit Shah Reviewed-by: Markus Armbruster --- balloon.c | 22 +++++++++++----------- balloon.h | 4 ---- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/balloon.c b/balloon.c index 248c1b5..f9bcf07 100644 --- a/balloon.c +++ b/balloon.c @@ -31,30 +31,30 @@ #include "trace.h" -static QEMUBalloonEvent *qemu_balloon_event; -void *qemu_balloon_event_opaque; +static QEMUBalloonEvent *balloon_event_fn; +static void *balloon_opaque; void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque) { - qemu_balloon_event = func; - qemu_balloon_event_opaque = opaque; + balloon_event_fn = func; + balloon_opaque = opaque; } -int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque) +static int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque) { - if (qemu_balloon_event) { - trace_balloon_event(qemu_balloon_event_opaque, target); - qemu_balloon_event(qemu_balloon_event_opaque, target, cb, opaque); + if (balloon_event_fn) { + trace_balloon_event(balloon_opaque, target); + balloon_event_fn(balloon_opaque, target, cb, opaque); return 1; } else { return 0; } } -int qemu_balloon_status(MonitorCompletion cb, void *opaque) +static int qemu_balloon_status(MonitorCompletion cb, void *opaque) { - if (qemu_balloon_event) { - qemu_balloon_event(qemu_balloon_event_opaque, 0, cb, opaque); + if (balloon_event_fn) { + balloon_event_fn(balloon_opaque, 0, cb, opaque); return 1; } else { return 0; diff --git a/balloon.h b/balloon.h index d478e28..06a8a46 100644 --- a/balloon.h +++ b/balloon.h @@ -21,10 +21,6 @@ typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target, void qemu_add_balloon_handler(QEMUBalloonEvent *func, void *opaque); -int qemu_balloon(ram_addr_t target, MonitorCompletion cb, void *opaque); - -int qemu_balloon_status(MonitorCompletion cb, void *opaque); - void monitor_print_balloon(Monitor *mon, const QObject *data); int do_info_balloon(Monitor *mon, MonitorCompletion cb, void *opaque); int do_balloon(Monitor *mon, const QDict *params,