From: Joerg R. <joe...@am...> - 2008-04-10 12:33:58
|
The compilation of kvm-userspace part fails if the in-kernel pit is not detected in <linux/kvm.h> with the following error message: pc.o: In function `pc_init1': /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined reference to `kvm_pit_init' collect2: ld returned 1 exit status This patch fixes this little issue. Signed-off-by: Joerg Roedel <joe...@am...> --- qemu/configure | 1 + qemu/hw/pc.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/qemu/configure b/qemu/configure index ca9bce2..bfbd93c 100755 --- a/qemu/configure +++ b/qemu/configure @@ -1187,6 +1187,7 @@ configure_kvm() { echo "CONFIG_KVM_KERNEL_INC=$kernel_path/include" >> $config_mak if test $kvm_cap_pit = "yes" ; then echo "USE_KVM_PIT=1" >> $config_mak + echo "#define USE_KVM_PIT 1" >> $config_h fi disable_cpu_emulation fi diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index 859d7db..aa9afea 100644 --- a/qemu/hw/pc.c +++ b/qemu/hw/pc.c @@ -983,9 +983,11 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, if (pci_enabled) { ioapic = ioapic_init(); } +#ifdef USE_KVM_PIT if (kvm_enabled() && qemu_kvm_pit_in_kernel()) pit = kvm_pit_init(0x40, i8259[0]); else +#endif pit = pit_init(0x40, i8259[0]); pcspk_init(pit); if (pci_enabled) { -- 1.5.2.5 |
From: Avi K. <av...@qu...> - 2008-04-10 23:19:02
|
Joerg Roedel wrote: > The compilation of kvm-userspace part fails if the in-kernel pit is not > detected in <linux/kvm.h> with the following error message: > > pc.o: In function `pc_init1': > /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined reference to `kvm_pit_init' > collect2: ld returned 1 exit status > > This patch fixes this little issue. > > Applied, thanks. -- Any sufficiently difficult bug is indistinguishable from a feature. |
From: Anthony L. <an...@co...> - 2008-04-11 04:25:48
|
Joerg Roedel wrote: > The compilation of kvm-userspace part fails if the in-kernel pit is not > detected in <linux/kvm.h> with the following error message: > > pc.o: In function `pc_init1': > /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined reference to `kvm_pit_init' > collect2: ld returned 1 exit status > > This patch fixes this little issue. > A better solution is to wrap qemu_kvm_put_in_kernel in an #ifdef KVM_CAP_PIT so that if it isn't defined, it always returns 0. gcc will then do the right thing. Regards, Anthony Liguori > Signed-off-by: Joerg Roedel <joe...@am...> > --- > qemu/configure | 1 + > qemu/hw/pc.c | 2 ++ > 2 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/qemu/configure b/qemu/configure > index ca9bce2..bfbd93c 100755 > --- a/qemu/configure > +++ b/qemu/configure > @@ -1187,6 +1187,7 @@ configure_kvm() { > echo "CONFIG_KVM_KERNEL_INC=$kernel_path/include" >> $config_mak > if test $kvm_cap_pit = "yes" ; then > echo "USE_KVM_PIT=1" >> $config_mak > + echo "#define USE_KVM_PIT 1" >> $config_h > fi > disable_cpu_emulation > fi > diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c > index 859d7db..aa9afea 100644 > --- a/qemu/hw/pc.c > +++ b/qemu/hw/pc.c > @@ -983,9 +983,11 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, > if (pci_enabled) { > ioapic = ioapic_init(); > } > +#ifdef USE_KVM_PIT > if (kvm_enabled() && qemu_kvm_pit_in_kernel()) > pit = kvm_pit_init(0x40, i8259[0]); > else > +#endif > pit = pit_init(0x40, i8259[0]); > pcspk_init(pit); > if (pci_enabled) { > |
From: Avi K. <av...@qu...> - 2008-04-11 12:05:56
|
Anthony Liguori wrote: > Joerg Roedel wrote: >> The compilation of kvm-userspace part fails if the in-kernel pit is not >> detected in <linux/kvm.h> with the following error message: >> >> pc.o: In function `pc_init1': >> /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined >> reference to `kvm_pit_init' >> collect2: ld returned 1 exit status >> >> This patch fixes this little issue. >> > > A better solution is to wrap qemu_kvm_put_in_kernel in an #ifdef > KVM_CAP_PIT so that if it isn't defined, it always returns 0. gcc > will then do the right thing. > I would like to move qemu from depending on linux/kvm.h directly. However, there is a lot of work needed to get that (including some pointless stuff like defining libkvm structures to take the place of kvm.h structures) so perhaps it is not a realistic goal. -- Any sufficiently difficult bug is indistinguishable from a feature. |
From: Anthony L. <an...@co...> - 2008-04-11 14:55:44
|
Avi Kivity wrote: > Anthony Liguori wrote: >> Joerg Roedel wrote: >>> The compilation of kvm-userspace part fails if the in-kernel pit is not >>> detected in <linux/kvm.h> with the following error message: >>> >>> pc.o: In function `pc_init1': >>> /home/jroedel/src/kvm/kvm-userspace/qemu/hw/pc.c:987: undefined >>> reference to `kvm_pit_init' >>> collect2: ld returned 1 exit status >>> >>> This patch fixes this little issue. >>> >> >> A better solution is to wrap qemu_kvm_put_in_kernel in an #ifdef >> KVM_CAP_PIT so that if it isn't defined, it always returns 0. gcc >> will then do the right thing. >> > > I would like to move qemu from depending on linux/kvm.h directly. > However, there is a lot of work needed to get that (including some > pointless stuff like defining libkvm structures to take the place of > kvm.h structures) so perhaps it is not a realistic goal. My real point was that the #ifdef should be in the definition of qemu_kvm_put_in_kernel() as opposed to in C code. If we use #ifdef USE_KVM_PIT instead of #ifdef KVM_CAP_PIT that's fine by me. Regards, Anthony Liguori |