kvm: create kvmclock when one of the flags are present

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>
This commit is contained in:
Glauber Costa 2011-03-17 19:42:07 -03:00 committed by Marcelo Tosatti
parent 642258c6c7
commit 450fb75c47
1 changed files with 5 additions and 1 deletions

View File

@ -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);
}
}