public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Joerg Roedel <joerg.roedel@amd.com>
Cc: kvm-devel@lists.sourceforge.net, Avi Kivity <avi@qumranet.com>
Subject: Re: [PATCH] kvm-userspace: fix compilation breakage when in-kernel pit is not detected
Date: Thu, 10 Apr 2008 23:25:50 -0500	[thread overview]
Message-ID: <47FEE84E.30206@codemonkey.ws> (raw)
In-Reply-To: <1207830824-1590-1-git-send-email-joerg.roedel@amd.com>

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 <joerg.roedel@amd.com>
> ---
>  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) {
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

  parent reply	other threads:[~2008-04-11  4:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 12:33 [PATCH] kvm-userspace: fix compilation breakage when in-kernel pit is not detected Joerg Roedel
2008-04-10 23:17 ` Avi Kivity
2008-04-11  4:25 ` Anthony Liguori [this message]
2008-04-11 12:05   ` Avi Kivity
2008-04-11 14:55     ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47FEE84E.30206@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=avi@qumranet.com \
    --cc=joerg.roedel@amd.com \
    --cc=kvm-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox