qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Makefile: Fix compilation for non-standard host kernel path
@ 2010-07-02 11:15 Prerna Saxena
  2010-07-06 19:40 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Prerna Saxena @ 2010-07-02 11:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, Anthony Liguori

Set up host kernel include paths specified by --kerneldir

When host kernel headers are placed in non-standard paths, the
KVM_CFLAGS are presently invoked only for a few .c files 
(kvm*.c,vhost*.c) and not for other files like machine.c, cpus.c
  ..etc which also depend on linux/kvm.h

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
---
  Makefile.target |    7 +++++--
  1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile.target b/Makefile.target
index d58b201..b433112 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -29,12 +29,15 @@ QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
  endif
  endif

+# Set up host kernel include paths specified by --kerneldir
+ifdef CONFIG_KVM
+QEMU_CFLAGS+=$(KVM_CFLAGS)
+endif
+
  PROGS=$(QEMU_PROG)

  LIBS+=-lm

-kvm.o kvm-all.o vhost.o vhost_net.o: QEMU_CFLAGS+=$(KVM_CFLAGS)
-
  config-target.h: config-target.h-timestamp
  config-target.h-timestamp: config-target.mak

-- 
1.6.2.5



-- 
Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India

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

* Re: [Qemu-devel] [PATCH] Makefile: Fix compilation for non-standard host kernel path
  2010-07-02 11:15 [Qemu-devel] [PATCH] Makefile: Fix compilation for non-standard host kernel path Prerna Saxena
@ 2010-07-06 19:40 ` Anthony Liguori
  2010-07-07  8:26   ` Prerna Saxena
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2010-07-06 19:40 UTC (permalink / raw)
  To: Prerna Saxena; +Cc: blauwirbel, qemu-devel

On 07/02/2010 06:15 AM, Prerna Saxena wrote:
> Set up host kernel include paths specified by --kerneldir
>
> When host kernel headers are placed in non-standard paths, the
> KVM_CFLAGS are presently invoked only for a few .c files 
> (kvm*.c,vhost*.c) and not for other files like machine.c, cpus.c
>  ..etc which also depend on linux/kvm.h

I think that's a bug.  What's the dependency of machine.c and cpus.c?

Regards,

Anthony Liguori

>
> Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
> ---
>  Makefile.target |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index d58b201..b433112 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -29,12 +29,15 @@ QEMU_PROG=qemu-system-$(TARGET_ARCH2)$(EXESUF)
>  endif
>  endif
>
> +# Set up host kernel include paths specified by --kerneldir
> +ifdef CONFIG_KVM
> +QEMU_CFLAGS+=$(KVM_CFLAGS)
> +endif
> +
>  PROGS=$(QEMU_PROG)
>
>  LIBS+=-lm
>
> -kvm.o kvm-all.o vhost.o vhost_net.o: QEMU_CFLAGS+=$(KVM_CFLAGS)
> -
>  config-target.h: config-target.h-timestamp
>  config-target.h-timestamp: config-target.mak
>

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

* Re: [Qemu-devel] [PATCH] Makefile: Fix compilation for non-standard host kernel path
  2010-07-06 19:40 ` Anthony Liguori
@ 2010-07-07  8:26   ` Prerna Saxena
  0 siblings, 0 replies; 3+ messages in thread
From: Prerna Saxena @ 2010-07-07  8:26 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: blauwirbel, Maneesh Soni, Ananth, qemu-devel

On 07/07/2010 01:10 AM, Anthony Liguori wrote:
> On 07/02/2010 06:15 AM, Prerna Saxena wrote:
>> Set up host kernel include paths specified by --kerneldir
>>
>> When host kernel headers are placed in non-standard paths, the
>> KVM_CFLAGS are presently invoked only for a few .c files
>> (kvm*.c,vhost*.c) and not for other files like machine.c, cpus.c
>> ..etc which also depend on linux/kvm.h
>
> I think that's a bug. What's the dependency of machine.c and cpus.c?
>

Both machine.d and cpus.d depend on qemu/kvm.h, which in turn needs 
linux/kvm.h

I am running a custom-compiled kernel for which the headers are placed 
separately. I pass the kernel source directory to my configure script as 
follows :

[usr@zephyr ~]$ configure --prefix=/home/bloat/qemu-git/qemu-bin 
--enable-kvm --target-list=i386-softmmu,x86_64-softmmu --enable-profiler 
--disable-docs --kerneldir=/home/bloat/kernels/linux-2.6.35-rc3
[usr@zephyr ~]$ make -j2

This is one of the errors I get : (similar ones are flagged for 
machine.o and cpus.o)

CC    i386-softmmu/arch_init.o
In file included from /home/bloat/qemu-git/qemu/arch_init.c:38:
/home/bloat/qemu-git/qemu/kvm.h:22:23: error: linux/kvm.h: No such file 
or directory
make[1]: *** [arch_init.o] Error 1

This is because the location of kernel headers is not passed as a '-I' 
switch to gcc. IMO adding the KVM_CFLAGS to QEMU_CFLAGS would be 
required for such cases.

Regards,
-- 
Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India

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

end of thread, other threads:[~2010-07-07  8:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-02 11:15 [Qemu-devel] [PATCH] Makefile: Fix compilation for non-standard host kernel path Prerna Saxena
2010-07-06 19:40 ` Anthony Liguori
2010-07-07  8:26   ` Prerna Saxena

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).