qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] KVM: cleanup unnecessary #ifdef KVM_CAP_...
@ 2018-08-21 13:34 Paolo Bonzini
  2018-08-21 13:45 ` David Hildenbrand
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2018-08-21 13:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: david

The capability macros are always defined, since they come from kernel
headers that are copied into the QEMU tree.  Remove the unnecessary #ifdefs.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 accel/kvm/kvm-all.c | 2 --
 target/i386/kvm.c   | 8 --------
 2 files changed, 10 deletions(-)

diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 38f468d..de12f78 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -1639,10 +1639,8 @@ static int kvm_init(MachineState *ms)
         s->irq_set_ioctl = KVM_IRQ_LINE_STATUS;
     }
 
-#ifdef KVM_CAP_READONLY_MEM
     kvm_readonly_mem_allowed =
         (kvm_check_extension(s, KVM_CAP_READONLY_MEM) > 0);
-#endif
 
     kvm_eventfds_allowed =
         (kvm_check_extension(s, KVM_CAP_IOEVENTFD) > 0);
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 9313602..0b2a07d 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1381,17 +1381,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
     int ret;
     struct utsname utsname;
 
-#ifdef KVM_CAP_XSAVE
     has_xsave = kvm_check_extension(s, KVM_CAP_XSAVE);
-#endif
-
-#ifdef KVM_CAP_XCRS
     has_xcrs = kvm_check_extension(s, KVM_CAP_XCRS);
-#endif
-
-#ifdef KVM_CAP_PIT_STATE2
     has_pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);
-#endif
 
     hv_vpindex_settable = kvm_check_extension(s, KVM_CAP_HYPERV_VP_INDEX);
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] KVM: cleanup unnecessary #ifdef KVM_CAP_...
  2018-08-21 13:34 [Qemu-devel] [PATCH] KVM: cleanup unnecessary #ifdef KVM_CAP_ Paolo Bonzini
@ 2018-08-21 13:45 ` David Hildenbrand
  0 siblings, 0 replies; 2+ messages in thread
From: David Hildenbrand @ 2018-08-21 13:45 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel

On 21.08.2018 15:34, Paolo Bonzini wrote:
> The capability macros are always defined, since they come from kernel
> headers that are copied into the QEMU tree.  Remove the unnecessary #ifdefs.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  accel/kvm/kvm-all.c | 2 --
>  target/i386/kvm.c   | 8 --------
>  2 files changed, 10 deletions(-)
> 
> diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
> index 38f468d..de12f78 100644
> --- a/accel/kvm/kvm-all.c
> +++ b/accel/kvm/kvm-all.c
> @@ -1639,10 +1639,8 @@ static int kvm_init(MachineState *ms)
>          s->irq_set_ioctl = KVM_IRQ_LINE_STATUS;
>      }
>  
> -#ifdef KVM_CAP_READONLY_MEM
>      kvm_readonly_mem_allowed =
>          (kvm_check_extension(s, KVM_CAP_READONLY_MEM) > 0);
> -#endif
>  
>      kvm_eventfds_allowed =
>          (kvm_check_extension(s, KVM_CAP_IOEVENTFD) > 0);
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index 9313602..0b2a07d 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -1381,17 +1381,9 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
>      int ret;
>      struct utsname utsname;
>  
> -#ifdef KVM_CAP_XSAVE
>      has_xsave = kvm_check_extension(s, KVM_CAP_XSAVE);
> -#endif
> -
> -#ifdef KVM_CAP_XCRS
>      has_xcrs = kvm_check_extension(s, KVM_CAP_XCRS);
> -#endif
> -
> -#ifdef KVM_CAP_PIT_STATE2
>      has_pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);
> -#endif
>  
>      hv_vpindex_settable = kvm_check_extension(s, KVM_CAP_HYPERV_VP_INDEX);
>  
> 

indeed,

Reviewed-by: David Hildenbrand <david@redhat.com>

-- 

Thanks,

David / dhildenb

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-21 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21 13:34 [Qemu-devel] [PATCH] KVM: cleanup unnecessary #ifdef KVM_CAP_ Paolo Bonzini
2018-08-21 13:45 ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).