Patchwork [3/3] don't create kvmclock when one of the flags are present.

login
register
mail settings
Submitter Glauber Costa
Date March 17, 2011, 10:42 p.m.
Message ID <1300401727-5235-4-git-send-email-glommer@redhat.com>
Download mbox | patch
Permalink /patch/87442/
State New
Headers show

Comments

Glauber Costa - March 17, 2011, 10:42 p.m.
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>
---
 hw/kvmclock.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Jan Kiszka - March 18, 2011, 10:24 a.m.
On 2011-03-17 23:42, Glauber Costa wrote:
> kvmclock presence can be signalled by two different flags. So for
> device creation, we have to test for both.

Patch is OK, but the subject's logic is inverted.

Jan

> 
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
>  hw/kvmclock.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> 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);
>      }
>  }
Glauber Costa - March 18, 2011, 2:29 p.m.
On Fri, 2011-03-18 at 11:24 +0100, Jan Kiszka wrote:
> On 2011-03-17 23:42, Glauber Costa wrote:
> > kvmclock presence can be signalled by two different flags. So for
> > device creation, we have to test for both.

> Patch is OK, but the subject's logic is inverted.
Indeed, should have said something like "to test for either of them"

Dear maintainers, is it okay to commit with a minor edit to the
changelogs?

> Jan
> 
> > 
> > Signed-off-by: Glauber Costa <glommer@redhat.com>
> > ---
> >  hw/kvmclock.c |    6 +++++-
> >  1 files changed, 5 insertions(+), 1 deletions(-)
> > 
> > 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);
> >      }
> >  }
>

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