Patchwork [2/9] target-i386: add stubs for hyperv_(vapic_recommended|relaxed_timing_enabled|get_spinlock_retries)()

login
register
mail settings
Submitter Igor Mammedov
Date Feb. 11, 2013, 4:35 p.m.
Message ID <1360600511-25133-3-git-send-email-imammedo@redhat.com>
Download mbox | patch
Permalink /patch/219650/
State New
Headers show

Comments

Igor Mammedov - Feb. 11, 2013, 4:35 p.m.
It's needed for converting hv_* features into properties and to
avoid build breakage when qemu is built with --disable-kvm option.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reported-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/hyperv.h |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
Eduardo Habkost - Feb. 19, 2013, 6:38 p.m.
On Mon, Feb 11, 2013 at 05:35:04PM +0100, Igor Mammedov wrote:
> It's needed for converting hv_* features into properties and to
> avoid build breakage when qemu is built with --disable-kvm option.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> Reported-by: Eduardo Habkost <ehabkost@redhat.com>

I hope we avoid the need for the stubs when we implement the
KVM-specific subclasses (that I assume wouldn't be compiled if
--disable-kvm is used). But by now we will need the stubs, so:

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>

> ---
>  target-i386/hyperv.h |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
> index bacb1d4..7bd4d9e 100644
> --- a/target-i386/hyperv.h
> +++ b/target-i386/hyperv.h
> @@ -30,16 +30,19 @@
>  void hyperv_enable_vapic_recommended(bool val);
>  void hyperv_enable_relaxed_timing(bool val);
>  void hyperv_set_spinlock_retries(int val);
> +bool hyperv_vapic_recommended(void);
> +bool hyperv_relaxed_timing_enabled(void);
> +int hyperv_get_spinlock_retries(void);
>  #else
>  static inline void hyperv_enable_vapic_recommended(bool val) { }
>  static inline void hyperv_enable_relaxed_timing(bool val) { }
>  static inline void hyperv_set_spinlock_retries(int val) { }
> +static inline bool hyperv_vapic_recommended(void) { return false; }
> +static inline bool hyperv_relaxed_timing_enabled(void) { return false; }
> +static inline int  hyperv_get_spinlock_retries(void) { return 0; }
>  #endif
>  
>  bool hyperv_enabled(void);
>  bool hyperv_hypercall_available(void);
> -bool hyperv_vapic_recommended(void);
> -bool hyperv_relaxed_timing_enabled(void);
> -int hyperv_get_spinlock_retries(void);
>  
>  #endif /* QEMU_HW_HYPERV_H */
> -- 
> 1.7.1
> 
>

Patch

diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
index bacb1d4..7bd4d9e 100644
--- a/target-i386/hyperv.h
+++ b/target-i386/hyperv.h
@@ -30,16 +30,19 @@ 
 void hyperv_enable_vapic_recommended(bool val);
 void hyperv_enable_relaxed_timing(bool val);
 void hyperv_set_spinlock_retries(int val);
+bool hyperv_vapic_recommended(void);
+bool hyperv_relaxed_timing_enabled(void);
+int hyperv_get_spinlock_retries(void);
 #else
 static inline void hyperv_enable_vapic_recommended(bool val) { }
 static inline void hyperv_enable_relaxed_timing(bool val) { }
 static inline void hyperv_set_spinlock_retries(int val) { }
+static inline bool hyperv_vapic_recommended(void) { return false; }
+static inline bool hyperv_relaxed_timing_enabled(void) { return false; }
+static inline int  hyperv_get_spinlock_retries(void) { return 0; }
 #endif
 
 bool hyperv_enabled(void);
 bool hyperv_hypercall_available(void);
-bool hyperv_vapic_recommended(void);
-bool hyperv_relaxed_timing_enabled(void);
-int hyperv_get_spinlock_retries(void);
 
 #endif /* QEMU_HW_HYPERV_H */