kvmclock: Fix feature detection
PATCH 1/1 kvmclock: Fix feature detection
From: Jan Kiszka <[email protected]>
Bit-wise or the feature flags and drop the obsolete #ifdef.
Signed-off-by Jan Kiszka <[email protected]>
--- hw/kvmclock.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
hw/kvmclock.c +2 -5
@@ -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
Marcelo Tosatti
AppliedQuoted 8 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Bit-wise or the feature flags and drop the obsolete #ifdef.
Signed-off-by Jan Kiszka <[email protected]>--- hw/kvmclock.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-)
Applied, thanks.
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.
Signed-off-by Jan Kiszka <[email protected]>--- 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