From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPL9R-0006KS-GB for qemu-devel@nongnu.org; Tue, 01 May 2012 18:02:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SPL9P-0003OG-C1 for qemu-devel@nongnu.org; Tue, 01 May 2012 18:02:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42672 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SPL9P-0003O4-22 for qemu-devel@nongnu.org; Tue, 01 May 2012 18:02:27 -0400 Message-ID: <4FA05D70.9070509@suse.de> Date: Wed, 02 May 2012 00:02:24 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1335558083-26196-1-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1335558083-26196-1-git-send-email-mdroth@linux.vnet.ibm.com> Content-Type: multipart/mixed; boundary="------------020505080009060607090602" Subject: Re: [Qemu-devel] [PATCH v5 0/7] add fixed-width visitors and serialization tests/fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Roth Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------020505080009060607090602 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Am 27.04.2012 22:21, schrieb Michael Roth: > These patches apply on top of qemu.git master, and can also be obtained= from: > git://github.com/mdroth/qemu.git visitor-fixed-width-v5 I've tested that branch by running some random guests without noticeable problems and by testing X86CPU level/xlevel simplifications on top (attached). NOTE: There is a v6 patch with fixed commit message hidden as reply within this series but there is no matching -v6 branch pushed yet. That being said, v5 series Tested-by: Andreas F=E4rber Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg --------------020505080009060607090602 Content-Type: text/x-patch; name="0001-target-i386-Use-uint32-visitor-for-x-level-propertie.patch" Content-Disposition: attachment; filename*0="0001-target-i386-Use-uint32-visitor-for-x-level-propertie.pa"; filename*1="tch" Content-Transfer-Encoding: quoted-printable >>From b19a05c8dff628af5f0170cc53c8319af0074104 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?Andreas=3D20F=3DC3=3DA4rber?=3D Date: Tue, 1 May 2012 23:33:13 +0200 Subject: [PATCH] target-i386: Use uint32 visitor for [x]level properties MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit This simplifies the code and resolves TODOs. Signed-off-by: Andreas F=C3=A4rber --- target-i386/cpu.c | 42 ++++-------------------------------------- 1 files changed, 4 insertions(+), 38 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 65d9af6..af8e1f3 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -715,66 +715,32 @@ static void x86_cpuid_get_level(Object *obj, Visito= r *v, void *opaque, const char *name, Error **errp) { X86CPU *cpu =3D X86_CPU(obj); - int64_t value; =20 - value =3D cpu->env.cpuid_level; - /* TODO Use visit_type_uint32() once available */ - visit_type_int(v, &value, name, errp); + visit_type_uint32(v, &cpu->env.cpuid_level, name, errp); } =20 static void x86_cpuid_set_level(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { X86CPU *cpu =3D X86_CPU(obj); - const int64_t min =3D 0; - const int64_t max =3D UINT32_MAX; - int64_t value; - - /* TODO Use visit_type_uint32() once available */ - visit_type_int(v, &value, name, errp); - if (error_is_set(errp)) { - return; - } - if (value < min || value > max) { - error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, min, max); - return; - } =20 - cpu->env.cpuid_level =3D value; + visit_type_uint32(v, &cpu->env.cpuid_level, name, errp); } =20 static void x86_cpuid_get_xlevel(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { X86CPU *cpu =3D X86_CPU(obj); - int64_t value; =20 - value =3D cpu->env.cpuid_xlevel; - /* TODO Use visit_type_uint32() once available */ - visit_type_int(v, &value, name, errp); + visit_type_uint32(v, &cpu->env.cpuid_xlevel, name, errp); } =20 static void x86_cpuid_set_xlevel(Object *obj, Visitor *v, void *opaque, const char *name, Error **errp) { X86CPU *cpu =3D X86_CPU(obj); - const int64_t min =3D 0; - const int64_t max =3D UINT32_MAX; - int64_t value; - - /* TODO Use visit_type_uint32() once available */ - visit_type_int(v, &value, name, errp); - if (error_is_set(errp)) { - return; - } - if (value < min || value > max) { - error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE, "", - name ? name : "null", value, min, max); - return; - } =20 - cpu->env.cpuid_xlevel =3D value; + visit_type_uint32(v, &cpu->env.cpuid_xlevel, name, errp); } =20 static char *x86_cpuid_get_vendor(Object *obj, Error **errp) --=20 1.7.7 --------------020505080009060607090602--