From: "Daniel P. Berrange" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Markus Armbruster" <armbru@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH RFC 6/7] x86-cpu: register properties against the class instead of object
Date: Wed, 26 Aug 2015 13:03:13 +0100 [thread overview]
Message-ID: <1440590594-5514-7-git-send-email-berrange@redhat.com> (raw)
In-Reply-To: <1440590594-5514-1-git-send-email-berrange@redhat.com>
This converts the x86 CPU object to register its properties against
the class rather than object.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
---
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 = {
--
2.4.3
next prev parent reply other threads:[~2015-08-26 12:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-26 12:03 [Qemu-devel] [PATCH RFC 0/7] Making QOM introspectable Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 1/7] qom: allow properties to be registered against classes Daniel P. Berrange
2015-09-02 16:18 ` Andreas Färber
2015-09-03 15:49 ` Daniel P. Berrange
2015-09-03 16:37 ` Markus Armbruster
2015-09-03 16:41 ` Andreas Färber
2015-09-03 17:02 ` Markus Armbruster
2015-09-03 17:09 ` Daniel P. Berrange
2015-09-03 17:21 ` Andreas Färber
2015-09-03 17:25 ` Daniel P. Berrange
2015-09-04 6:56 ` Markus Armbruster
2015-09-07 12:54 ` Paolo Bonzini
2015-09-11 16:09 ` Daniel P. Berrange
2015-09-04 21:38 ` Marc-André Lureau
2015-09-07 8:46 ` Daniel P. Berrange
2015-09-07 13:11 ` Andreas Färber
2015-09-07 13:17 ` Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 2/7] hostmem: register properties against the class instead of object Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 3/7] rng: " Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 4/7] tpm: " Daniel P. Berrange
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 5/7] cpu: avoid using object instance state in property getter Daniel P. Berrange
2015-08-26 12:03 ` Daniel P. Berrange [this message]
2015-08-26 12:03 ` [Qemu-devel] [PATCH RFC 7/7] machine: register properties against the class instead of object Daniel P. Berrange
2015-09-02 9:05 ` [Qemu-devel] [PATCH RFC 0/7] Making QOM introspectable Daniel P. Berrange
2015-09-02 11:14 ` Markus Armbruster
2015-09-02 16:16 ` Andreas Färber
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1440590594-5514-7-git-send-email-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).