From nobody Tue Oct 28 02:08:42 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516205037709812.0221343316672; Wed, 17 Jan 2018 08:03:57 -0800 (PST) Received: from localhost ([::1]:44313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebqBv-0002rv-SZ for importer@patchew.org; Wed, 17 Jan 2018 11:03:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebpv0-0005q5-MP for qemu-devel@nongnu.org; Wed, 17 Jan 2018 10:46:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebpuw-0000n9-Im for qemu-devel@nongnu.org; Wed, 17 Jan 2018 10:46:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48282) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ebpuw-0000km-9d for qemu-devel@nongnu.org; Wed, 17 Jan 2018 10:46:22 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1AFC47EA93; Wed, 17 Jan 2018 15:46:21 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id F39E94A7; Wed, 17 Jan 2018 15:46:13 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Wed, 17 Jan 2018 16:43:36 +0100 Message-Id: <1516203816-19374-25-git-send-email-imammedo@redhat.com> In-Reply-To: <1516203816-19374-1-git-send-email-imammedo@redhat.com> References: <1516203816-19374-1-git-send-email-imammedo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 17 Jan 2018 15:46:21 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 24/24] cpu: get rid of cpu_generic_init() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Richard Henderson , Laurent Vivier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Emilio G. Cota" , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There aren't any users of the helper left, remove it. Signed-off-by: Igor Mammedov --- CC: Richard Henderson CC: "Emilio G. Cota" CC: Paolo Bonzini CC: Eduardo Habkost CC: "Alex Benn=C3=A9e" CC: "Philippe Mathieu-Daud=C3=A9" --- include/qom/cpu.h | 11 ----------- qom/cpu.c | 25 ++----------------------- 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 93bd546..5446040 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -673,17 +673,6 @@ CPUState *cpu_create(const char *typename); const char *cpu_parse_cpu_model(const char *typename, const char *cpu_mode= l); =20 /** - * cpu_generic_init: - * @typename: The CPU base type. - * @cpu_model: The model string including optional parameters. - * - * Instantiates a CPU, processes optional parameters and realizes the CPU. - * - * Returns: A #CPUState or %NULL if an error occurred. - */ -CPUState *cpu_generic_init(const char *typename, const char *cpu_model); - -/** * cpu_has_work: * @cpu: The vCPU to check. * diff --git a/qom/cpu.c b/qom/cpu.c index e42d9a7..7ab7c36 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -90,14 +90,6 @@ const char *cpu_parse_cpu_model(const char *typename, co= nst char *cpu_model) return cpu_type; } =20 -CPUState *cpu_generic_init(const char *typename, const char *cpu_model) -{ - /* TODO: all callers of cpu_generic_init() need to be converted to - * call cpu_parse_features() only once, before calling cpu_generic_ini= t(). - */ - return cpu_create(cpu_parse_cpu_model(typename, cpu_model)); -} - bool cpu_paging_enabled(const CPUState *cpu) { CPUClass *cc =3D CPU_GET_CLASS(cpu); @@ -335,22 +327,9 @@ static ObjectClass *cpu_common_class_by_name(const cha= r *cpu_model) static void cpu_common_parse_features(const char *typename, char *features, Error **errp) { - char *featurestr; /* Single "key=3Dvalue" string being parsed */ char *val; - static bool cpu_globals_initialized; - - /* TODO: all callers of ->parse_features() need to be changed to - * call it only once, so we can remove this check (or change it - * to assert(!cpu_globals_initialized). - * Current callers of ->parse_features() are: - * - cpu_generic_init() - */ - if (cpu_globals_initialized) { - return; - } - cpu_globals_initialized =3D true; - - featurestr =3D features ? strtok(features, ",") : NULL; + /* Single "key=3Dvalue" string being parsed */ + char *featurestr =3D features ? strtok(features, ",") : NULL; =20 while (featurestr) { val =3D strchr(featurestr, '=3D'); --=20 2.7.4