Skip to contentSkip to conversation

kvmclock: Fix feature detection

PATCH Applied Jan Kiszka 2 participants 3 messages Jun 23, 2011 – Aug 4, 2011 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 kvmclock: Fix feature detection

From: Jan Kiszka <[email protected]>

Bit-wise or the feature flags and drop the obsolete #ifdef.

---
 hw/kvmclock.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
hw/kvmclock.c +2 -5
index 692ad18..b73aec4 100644
@@ -101,11 +101,8 @@ static SysBusDeviceInfo kvmclock_info = {
 void kvmclock_create(void)
 {
     if (kvm_enabled() &&
-        first_cpu->cpuid_kvm_features & ((1ULL << KVM_FEATURE_CLOCKSOURCE)
-#ifdef KVM_FEATURE_CLOCKSOURCE2
-        || (1ULL << KVM_FEATURE_CLOCKSOURCE2)
-#endif
-    )) {
+        first_cpu->cpuid_kvm_features & ((1ULL << KVM_FEATURE_CLOCKSOURCE) |
+                                         (1ULL << KVM_FEATURE_CLOCKSOURCE2))) {
         sysbus_create_simple("kvmclock", -1, NULL);
     }
 }
Signature · 1 line
1.7.1
author
#2 lore raw
Quoted 11 lines · Marcelo Tosatti
Quoted 8 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Bit-wise or the feature flags and drop the obsolete #ifdef.

---
 hw/kvmclock.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

Applied, thanks.

Please note that this stable-relevant bug fix is still stuck in uq/master. It should be able to break migration from older versions as the kvmclock vmstate is generated/expected incorrectly even if the feature is disabled.

Jan