Patchwork [3/6] kvm: create kvmclock when one of the flags are present

login
register
mail settings
Submitter Marcelo Tosatti
Date April 16, 2011, 10:10 p.m.
Message ID <bf4c0321645aff4dbe5bf06fcc8b4375f7fb2588.1302991808.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/91509/
State New
Headers show

Comments

Marcelo Tosatti - April 16, 2011, 10:10 p.m.
From: Glauber Costa <glommer@redhat.com>

kvmclock presence can be signalled by two different flags. So for
device creation, we have to test for both.

Signed-off-by: Glauber Costa <glommer@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/kvmclock.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/kvmclock.c b/hw/kvmclock.c
index b6ceddf..004c4ad 100644
--- a/hw/kvmclock.c
+++ b/hw/kvmclock.c
@@ -103,7 +103,11 @@  static SysBusDeviceInfo kvmclock_info = {
 void kvmclock_create(void)
 {
     if (kvm_enabled() &&
-        first_cpu->cpuid_kvm_features & (1ULL << KVM_FEATURE_CLOCKSOURCE)) {
+        first_cpu->cpuid_kvm_features & ((1ULL << KVM_FEATURE_CLOCKSOURCE)
+#ifdef KVM_FEATURE_CLOCKSOURCE2
+        || (1ULL << KVM_FEATURE_CLOCKSOURCE2)
+#endif
+    )) {
         sysbus_create_simple("kvmclock", -1, NULL);
     }
 }