From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThmpF-0003f4-Rk for qemu-devel@nongnu.org; Sun, 09 Dec 2012 14:46:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ThmpC-00052y-HQ for qemu-devel@nongnu.org; Sun, 09 Dec 2012 14:46:09 -0500 Received: from cantor2.suse.de ([195.135.220.15]:49229 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ThmpC-00052f-AZ for qemu-devel@nongnu.org; Sun, 09 Dec 2012 14:46:06 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sun, 9 Dec 2012 20:45:50 +0100 Message-Id: <1355082353-322-2-git-send-email-afaerber@suse.de> In-Reply-To: <1355082353-322-1-git-send-email-afaerber@suse.de> References: <1354645978-17362-1-git-send-email-ehabkost@redhat.com> <1355082353-322-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-cpu 1/4] target-i386: Inline -cpu host check into cpu_x86_register() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, imammedo@redhat.com, ehabkost@redhat.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= Simplifies the upcoming cleanup of cpu_x86_find_by_name(). Signed-off-by: Andreas F=C3=A4rber --- target-i386/cpu.c | 12 +++++++----- 1 Datei ge=C3=A4ndert, 7 Zeilen hinzugef=C3=BCgt(+), 5 Zeilen entfernt(-= ) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 7be3ad8..a46faa2 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1217,9 +1217,7 @@ static int cpu_x86_find_by_name(x86_def_t *x86_cpu_= def, const char *name) break; } } - if (kvm_enabled() && name && strcmp(name, "host") =3D=3D 0) { - kvm_cpu_fill_host(x86_cpu_def); - } else if (!def) { + if (!def) { return -1; } else { memcpy(x86_cpu_def, def, sizeof(*def)); @@ -1505,8 +1503,12 @@ int cpu_x86_register(X86CPU *cpu, const char *cpu_= model) name =3D model_pieces[0]; features =3D model_pieces[1]; =20 - if (cpu_x86_find_by_name(def, name) < 0) { - goto error; + if (kvm_enabled() && strcmp(name, "host") =3D=3D 0) { + kvm_cpu_fill_host(def); + } else { + if (cpu_x86_find_by_name(def, name) < 0) { + goto error; + } } =20 if (cpu_x86_parse_featurestr(def, features) < 0) { --=20 1.7.10.4