[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 5/9] target-i386: convert 'hv_vapic' to static prope
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 5/9] target-i386: convert 'hv_vapic' to static property |
Date: |
Mon, 11 Feb 2013 17:35:07 +0100 |
Signed-off-by: Igor Mammedov <address@hidden>
---
target-i386/cpu.c | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index b804031..0233985 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -560,6 +560,38 @@ PropertyInfo qdev_prop_hv_relaxed = {
.defval = _defval
\
}
+static void x86_get_hv_vapic(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ bool value = hyperv_vapic_recommended();
+
+ visit_type_bool(v, &value, name, errp);
+}
+
+static void x86_set_hv_vapic(Object *obj, Visitor *v, void *opaque,
+ const char *name, Error **errp)
+{
+ bool value;
+
+ visit_type_bool(v, &value, name, errp);
+ if (error_is_set(errp)) {
+ return;
+ }
+ hyperv_enable_vapic_recommended(value);
+}
+
+PropertyInfo qdev_prop_hv_vapic = {
+ .name = "boolean",
+ .get = x86_get_hv_vapic,
+ .set = x86_set_hv_vapic,
+};
+#define DEFINE_PROP_HV_VAPIC(_n, _defval) {
\
+ .name = _n,
\
+ .info = &qdev_prop_hv_vapic,
\
+ .qtype = QTYPE_QBOOL,
\
+ .defval = _defval
\
+}
+
static Property cpu_x86_properties[] = {
DEFINE_PROP_FAMILY("family"),
DEFINE_PROP_MODEL("model"),
@@ -571,6 +603,7 @@ static Property cpu_x86_properties[] = {
DEFINE_PROP_TSC_FREQ("tsc-frequency"),
DEFINE_PROP_HV_SPINLOCKS("hv-spinlocks", HYPERV_SPINLOCK_NEVER_RETRY),
DEFINE_PROP_HV_RELAXED("hv-relaxed", false),
+ DEFINE_PROP_HV_VAPIC("hv-vapic", false),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1503,7 +1536,7 @@ static void cpu_x86_parse_featurestr(X86CPU *cpu, char
*features, Error **errp)
} else if (!strcmp(featurestr, "hv_relaxed")) {
object_property_parse(OBJECT(cpu), "on", "hv-relaxed", errp);
} else if (!strcmp(featurestr, "hv_vapic")) {
- hyperv_enable_vapic_recommended(true);
+ object_property_parse(OBJECT(cpu), "on", "hv-vapic", errp);
} else {
error_setg(errp, "feature string `%s' not in format (+feature|"
"-feature|feature=xyz)\n", featurestr);
--
1.7.1
- Re: [Qemu-devel] [PATCH 1/9] target-i386: cpu: convert existing dynamic properties into static properties, (continued)
[Qemu-devel] [PATCH 4/9] target-i386: convert 'hv_relaxed' to static property, Igor Mammedov, 2013/02/11
- Re: [Qemu-devel] [PATCH 4/9] target-i386: convert 'hv_relaxed' to static property, Eduardo Habkost, 2013/02/19
- Re: [Qemu-devel] [PATCH 4/9] target-i386: convert 'hv_relaxed' to static property, Igor Mammedov, 2013/02/20
- Re: [Qemu-devel] [PATCH 4/9] target-i386: convert 'hv_relaxed' to static property, Eduardo Habkost, 2013/02/20
- Re: [Qemu-devel] [PATCH 4/9] target-i386: convert 'hv_relaxed' to static property, Igor Mammedov, 2013/02/22
- Re: [Qemu-devel] [PATCH 4/9] target-i386: convert 'hv_relaxed' to static property, Eduardo Habkost, 2013/02/22
[Qemu-devel] [PATCH 5/9] target-i386: convert 'hv_vapic' to static property,
Igor Mammedov <=
[Qemu-devel] [PATCH 2/9] target-i386: add stubs for hyperv_(vapic_recommended|relaxed_timing_enabled|get_spinlock_retries)(), Igor Mammedov, 2013/02/11
[Qemu-devel] [PATCH 7/9] target-i386: cleanup 'foo' feature handling', Igor Mammedov, 2013/02/11
[Qemu-devel] [PATCH 8/9] target-i386: cleanup 'foo=val' feature handling, Igor Mammedov, 2013/02/11
[Qemu-devel] [PATCH 3/9] target-i386: convert 'hv_spinlocks' to static property, Igor Mammedov, 2013/02/11
[Qemu-devel] [PATCH 6/9] target-i386: convert 'check' and 'enforce' to static properties, Igor Mammedov, 2013/02/11
[Qemu-devel] [PATCH 9/9] target-i386: set [+-]feature using static properties, Igor Mammedov, 2013/02/11