diff mbox

[1/5] xen: Fix xen_enabled().

Message ID 1310740376-13323-2-git-send-email-anthony.perard@citrix.com
State New
Headers show

Commit Message

Anthony PERARD July 15, 2011, 2:32 p.m. UTC
Use the "host" CONFIG_ define instead of the "target" one.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/xen.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Paolo Bonzini July 15, 2011, 2:46 p.m. UTC | #1
On 07/15/2011 04:32 PM, Anthony PERARD wrote:
> Use the "host" CONFIG_ define instead of the "target" one.
>
> Signed-off-by: Anthony PERARD<anthony.perard@citrix.com>
> ---
>   hw/xen.h |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/hw/xen.h b/hw/xen.h
> index e432705..43b95d6 100644
> --- a/hw/xen.h
> +++ b/hw/xen.h
> @@ -24,7 +24,7 @@ extern int xen_allowed;
>
>   static inline int xen_enabled(void)
>   {
> -#ifdef CONFIG_XEN
> +#ifdef CONFIG_XEN_BACKEND
>       return xen_allowed;
>   #else
>       return 0;

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Alexander Graf July 18, 2011, 12:43 p.m. UTC | #2
On 15.07.2011, at 16:32, Anthony Perard wrote:

> Use the "host" CONFIG_ define instead of the "target" one.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
> hw/xen.h |    2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/xen.h b/hw/xen.h
> index e432705..43b95d6 100644
> --- a/hw/xen.h
> +++ b/hw/xen.h
> @@ -24,7 +24,7 @@ extern int xen_allowed;
> 
> static inline int xen_enabled(void)
> {
> -#ifdef CONFIG_XEN
> +#ifdef CONFIG_XEN_BACKEND

is there any way to get this one more clever? The current patch fixes it for your use case, sure, but I'd prefer that if you do:

  ./configure --enable-xen --target-list=alpha-softmmu

I'll get xen_enabled to be inline exterminated and not slow down the alpha target. How about something like

#ifdef CONFIG_NO_XEN
    return 0;
#elif defined(CONFIG_XEN_BACKEND)
    return xen_allowed;
#else
    return 0;
#endif

That way code that is compiled per-target won't get slowed down just because we have the xen option on.


Alex
diff mbox

Patch

diff --git a/hw/xen.h b/hw/xen.h
index e432705..43b95d6 100644
--- a/hw/xen.h
+++ b/hw/xen.h
@@ -24,7 +24,7 @@  extern int xen_allowed;
 
 static inline int xen_enabled(void)
 {
-#ifdef CONFIG_XEN
+#ifdef CONFIG_XEN_BACKEND
     return xen_allowed;
 #else
     return 0;