From patchwork Wed Aug 26 12:03:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= X-Patchwork-Id: 510827 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 71D661401F0 for ; Wed, 26 Aug 2015 22:08:04 +1000 (AEST) Received: from localhost ([::1]:37919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZUo-0002gf-Km for incoming@patchwork.ozlabs.org; Wed, 26 Aug 2015 08:08:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39420) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZQS-0003wr-Pf for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:03:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUZQR-0007aD-Ls for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:03:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUZQR-0007Zz-EN for qemu-devel@nongnu.org; Wed, 26 Aug 2015 08:03:31 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id E41E48E74A; Wed, 26 Aug 2015 12:03:30 +0000 (UTC) Received: from localhost.localdomain.com (vpn1-4-60.ams2.redhat.com [10.36.4.60]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7QC3Ksq007745; Wed, 26 Aug 2015 08:03:29 -0400 From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Wed, 26 Aug 2015 13:03:13 +0100 Message-Id: <1440590594-5514-7-git-send-email-berrange@redhat.com> In-Reply-To: <1440590594-5514-1-git-send-email-berrange@redhat.com> References: <1440590594-5514-1-git-send-email-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Markus Armbruster , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH RFC 6/7] x86-cpu: register properties against the class instead of object 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 This converts the x86 CPU object to register its properties against the class rather than object. Signed-off-by: Daniel P. Berrange --- target-i386/cpu.c | 55 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 780a5bc..e183d0b 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -3038,33 +3038,6 @@ static void x86_cpu_initfn(Object *obj) cs->env_ptr = env; cpu_exec_init(cs, &error_abort); - object_property_add(obj, "family", "int", - x86_cpuid_version_get_family, - x86_cpuid_version_set_family, NULL, NULL, NULL); - object_property_add(obj, "model", "int", - x86_cpuid_version_get_model, - x86_cpuid_version_set_model, NULL, NULL, NULL); - object_property_add(obj, "stepping", "int", - x86_cpuid_version_get_stepping, - x86_cpuid_version_set_stepping, NULL, NULL, NULL); - object_property_add_str(obj, "vendor", - x86_cpuid_get_vendor, - x86_cpuid_set_vendor, NULL); - object_property_add_str(obj, "model-id", - x86_cpuid_get_model_id, - x86_cpuid_set_model_id, NULL); - object_property_add(obj, "tsc-frequency", "int", - x86_cpuid_get_tsc_freq, - x86_cpuid_set_tsc_freq, NULL, NULL, NULL); - object_property_add(obj, "apic-id", "int", - x86_cpuid_get_apic_id, - x86_cpuid_set_apic_id, NULL, NULL, NULL); - object_property_add(obj, "feature-words", "X86CPUFeatureWordInfo", - x86_cpu_get_feature_words, - NULL, NULL, NULL, NULL); - object_property_add(obj, "filtered-features", "X86CPUFeatureWordInfo", - x86_cpu_get_filtered_features, - NULL, NULL, NULL, NULL); cpu->hyperv_spinlock_attempts = HYPERV_SPINLOCK_NEVER_RETRY; @@ -3199,6 +3172,34 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) #endif cc->cpu_exec_enter = x86_cpu_exec_enter; cc->cpu_exec_exit = x86_cpu_exec_exit; + + object_class_property_add(oc, "family", "int", + x86_cpuid_version_get_family, + x86_cpuid_version_set_family, NULL, NULL, NULL); + object_class_property_add(oc, "model", "int", + x86_cpuid_version_get_model, + x86_cpuid_version_set_model, NULL, NULL, NULL); + object_class_property_add(oc, "stepping", "int", + x86_cpuid_version_get_stepping, + x86_cpuid_version_set_stepping, NULL, NULL, NULL); + object_class_property_add_str(oc, "vendor", + x86_cpuid_get_vendor, + x86_cpuid_set_vendor, NULL); + object_class_property_add_str(oc, "model-id", + x86_cpuid_get_model_id, + x86_cpuid_set_model_id, NULL); + object_class_property_add(oc, "tsc-frequency", "int", + x86_cpuid_get_tsc_freq, + x86_cpuid_set_tsc_freq, NULL, NULL, NULL); + object_class_property_add(oc, "apic-id", "int", + x86_cpuid_get_apic_id, + x86_cpuid_set_apic_id, NULL, NULL, NULL); + object_class_property_add(oc, "feature-words", "X86CPUFeatureWordInfo", + x86_cpu_get_feature_words, + NULL, NULL, NULL, NULL); + object_class_property_add(oc, "filtered-features", "X86CPUFeatureWordInfo", + x86_cpu_get_filtered_features, + NULL, NULL, NULL, NULL); } static const TypeInfo x86_cpu_type_info = {