From patchwork Thu Jan 27 13:10:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 80677 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C8364B7139 for ; Fri, 28 Jan 2011 00:14:19 +1100 (EST) Received: from localhost ([127.0.0.1]:36183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiRg0-0003Iz-II for incoming@patchwork.ozlabs.org; Thu, 27 Jan 2011 08:14:16 -0500 Received: from [140.186.70.92] (port=49383 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiRc9-0001Rw-Db for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiRc7-0000km-3i for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:17 -0500 Received: from david.siemens.de ([192.35.17.14]:19688) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiRc6-0000j1-7W for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:14 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id p0RDACEd029877; Thu, 27 Jan 2011 14:10:12 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p0RDA737009974; Thu, 27 Jan 2011 14:10:12 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Thu, 27 Jan 2011 14:10:05 +0100 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 21/22] Refactor kvm&tcg function names in cpus.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Pure interface cosmetics: Ensure that only kvm core services (as declared in kvm.h) start with "kvm_". Prepend "qemu_" to those that violate this rule in cpus.c. Also rename the corresponding tcg functions for the sake of consistency. Signed-off-by: Jan Kiszka --- cpus.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpus.c b/cpus.c index 88bed4e..559ec55 100644 --- a/cpus.c +++ b/cpus.c @@ -751,7 +751,7 @@ static void qemu_kvm_wait_io_event(CPUState *env) static int qemu_cpu_exec(CPUState *env); -static void *kvm_cpu_thread_fn(void *arg) +static void *qemu_kvm_cpu_thread_fn(void *arg) { CPUState *env = arg; int r; @@ -784,7 +784,7 @@ static void *kvm_cpu_thread_fn(void *arg) return NULL; } -static void *tcg_cpu_thread_fn(void *arg) +static void *qemu_tcg_cpu_thread_fn(void *arg) { CPUState *env = arg; @@ -903,7 +903,7 @@ void resume_all_vcpus(void) } } -static void tcg_init_vcpu(void *_env) +static void qemu_tcg_init_vcpu(void *_env) { CPUState *env = _env; /* share a single thread for all cpus with TCG */ @@ -911,7 +911,7 @@ static void tcg_init_vcpu(void *_env) env->thread = qemu_mallocz(sizeof(QemuThread)); env->halt_cond = qemu_mallocz(sizeof(QemuCond)); qemu_cond_init(env->halt_cond); - qemu_thread_create(env->thread, tcg_cpu_thread_fn, env); + qemu_thread_create(env->thread, qemu_tcg_cpu_thread_fn, env); while (env->created == 0) qemu_cond_timedwait(&qemu_cpu_cond, &qemu_global_mutex, 100); tcg_cpu_thread = env->thread; @@ -922,12 +922,12 @@ static void tcg_init_vcpu(void *_env) } } -static void kvm_start_vcpu(CPUState *env) +static void qemu_kvm_start_vcpu(CPUState *env) { env->thread = qemu_mallocz(sizeof(QemuThread)); env->halt_cond = qemu_mallocz(sizeof(QemuCond)); qemu_cond_init(env->halt_cond); - qemu_thread_create(env->thread, kvm_cpu_thread_fn, env); + qemu_thread_create(env->thread, qemu_kvm_cpu_thread_fn, env); while (env->created == 0) qemu_cond_timedwait(&qemu_cpu_cond, &qemu_global_mutex, 100); } @@ -939,9 +939,9 @@ void qemu_init_vcpu(void *_env) env->nr_cores = smp_cores; env->nr_threads = smp_threads; if (kvm_enabled()) - kvm_start_vcpu(env); + qemu_kvm_start_vcpu(env); else - tcg_init_vcpu(env); + qemu_tcg_init_vcpu(env); } void qemu_notify_event(void)