qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 21/37] target-i386: convert 'hv_relaxed' to static p


From: Igor Mammedov
Subject: [Qemu-devel] [PATCH 21/37] target-i386: convert 'hv_relaxed' to static property
Date: Mon, 22 Oct 2012 17:03:07 +0200

Signed-off-by: Igor Mammedov <address@hidden>
---
 target-i386/cpu.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 122e01a..029f28c 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -181,6 +181,34 @@ PropertyInfo qdev_prop_spinlocks = {
 #define DEFINE_PROP_HV_SPINLOCKS(_n)                                           
\
     DEFINE_ABSTRACT_PROP(_n, qdev_prop_spinlocks)
 
+static void x86_get_hv_relaxed(Object *obj, Visitor *v, void *opaque,
+                                 const char *name, Error **errp)
+{
+    bool value = hyperv_relaxed_timing_enabled();
+
+    visit_type_bool(v, &value, name, errp);
+}
+
+static void x86_set_hv_relaxed(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_relaxed_timing(value);
+}
+
+PropertyInfo qdev_prop_hv_relaxed = {
+    .name  = "boolean",
+    .get   = x86_get_hv_relaxed,
+    .set   = x86_set_hv_relaxed,
+};
+#define DEFINE_PROP_HV_RELAXED(_n)                                             
\
+    DEFINE_ABSTRACT_PROP(_n, qdev_prop_hv_relaxed)
+
 static Property cpu_x86_properties[] = {
     DEFINE_PROP_BIT("f-fpu", X86CPU, env.cpuid_features,  0, false),
     DEFINE_PROP_BIT("f-vme", X86CPU, env.cpuid_features,  1, false),
@@ -296,6 +324,7 @@ static Property cpu_x86_properties[] = {
     DEFINE_PROP_UINT32("xlevel", X86CPU, env.cpuid_xlevel, 0),
     DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, 0),
     DEFINE_PROP_HV_SPINLOCKS("hv_spinlocks"),
+    DEFINE_PROP_HV_RELAXED("hv_relaxed"),
     DEFINE_PROP_END_OF_LIST(),
  };
 
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]