Patchwork hyperv: fix build on non-KVM hosts

login
register
mail settings
Submitter Vadim Rozenfeld
Date Jan. 24, 2012, 7:50 p.m.
Message ID <bc84bd17-33c0-4621-9897-af70d763ec60@zmail09.collab.prod.int.phx2.redhat.com>
Download mbox | patch
Permalink /patch/137634/
State New
Headers show

Comments

Vadim Rozenfeld - Jan. 24, 2012, 7:50 p.m.
----- Original Message -----
From: "Blue Swirl" <blauwirbel@gmail.com>
To: vrozenfe@redhat.com, "qemu-devel" <qemu-devel@nongnu.org>
Sent: Monday, January 23, 2012 10:10:51 PM
Subject: [PATCH] hyperv: fix build on non-KVM hosts

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---

Maybe a better fix would be to allow hyperv to be used also on TCG.

[VR] Yes, it could be nice. But, sadly, I have no time to do it, 
at least not in the near future.
Best,
Vadim.

---
 Makefile.target      |    2 +-
 target-i386/hyperv.h |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Blue Swirl - Jan. 25, 2012, 6:02 p.m.
On Tue, Jan 24, 2012 at 19:50, Vadim Rozenfeld <vrozenfe@redhat.com> wrote:
>
>
> ----- Original Message -----
> From: "Blue Swirl" <blauwirbel@gmail.com>
> To: vrozenfe@redhat.com, "qemu-devel" <qemu-devel@nongnu.org>
> Sent: Monday, January 23, 2012 10:10:51 PM
> Subject: [PATCH] hyperv: fix build on non-KVM hosts
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
>
> Maybe a better fix would be to allow hyperv to be used also on TCG.
>
> [VR] Yes, it could be nice. But, sadly, I have no time to do it,
> at least not in the near future.
> Best,
> Vadim.

OK, I applied this patch then.

> ---
>  Makefile.target      |    2 +-
>  target-i386/hyperv.h |    4 +++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index 092565a..69193d4 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -201,7 +201,7 @@ obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
>  obj-y += memory.o savevm.o
>  LIBS+=-lz
>
> -obj-i386-y +=hyperv.o
> +obj-i386-$(CONFIG_KVM) += hyperv.o
>
>  QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
>  QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
> diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
> index 15467bf..bacb1d4 100644
> --- a/target-i386/hyperv.h
> +++ b/target-i386/hyperv.h
> @@ -14,7 +14,9 @@
>  #define QEMU_HW_HYPERV_H 1
>
>  #include "qemu-common.h"
> +#ifdef CONFIG_KVM
>  #include <asm/hyperv.h>
> +#endif
>
>  #ifndef HYPERV_SPINLOCK_NEVER_RETRY
>  #define HYPERV_SPINLOCK_NEVER_RETRY             0xFFFFFFFF
> @@ -24,7 +26,7 @@
>  #define KVM_CPUID_SIGNATURE_NEXT                0x40000100
>  #endif
>
> -#ifndef CONFIG_USER_ONLY
> +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_KVM)
>  void hyperv_enable_vapic_recommended(bool val);
>  void hyperv_enable_relaxed_timing(bool val);
>  void hyperv_set_spinlock_retries(int val);
> --
> 1.7.9.rc0

Patch

diff --git a/Makefile.target b/Makefile.target
index 092565a..69193d4 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -201,7 +201,7 @@  obj-$(CONFIG_VGA_CIRRUS) += cirrus_vga.o
 obj-y += memory.o savevm.o
 LIBS+=-lz

-obj-i386-y +=hyperv.o
+obj-i386-$(CONFIG_KVM) += hyperv.o

 QEMU_CFLAGS += $(VNC_TLS_CFLAGS)
 QEMU_CFLAGS += $(VNC_SASL_CFLAGS)
diff --git a/target-i386/hyperv.h b/target-i386/hyperv.h
index 15467bf..bacb1d4 100644
--- a/target-i386/hyperv.h
+++ b/target-i386/hyperv.h
@@ -14,7 +14,9 @@ 
 #define QEMU_HW_HYPERV_H 1

 #include "qemu-common.h"
+#ifdef CONFIG_KVM
 #include <asm/hyperv.h>
+#endif

 #ifndef HYPERV_SPINLOCK_NEVER_RETRY
 #define HYPERV_SPINLOCK_NEVER_RETRY             0xFFFFFFFF
@@ -24,7 +26,7 @@ 
 #define KVM_CPUID_SIGNATURE_NEXT                0x40000100
 #endif

-#ifndef CONFIG_USER_ONLY
+#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_KVM)
 void hyperv_enable_vapic_recommended(bool val);
 void hyperv_enable_relaxed_timing(bool val);
 void hyperv_set_spinlock_retries(int val);