public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Mark McLoughlin <markmc@redhat.com>
Cc: Avi Kivity <avi@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] Fix pcspk build with kvm disabled
Date: Mon, 29 Jun 2009 18:00:42 +0200	[thread overview]
Message-ID: <4A48E52A.9060004@siemens.com> (raw)
In-Reply-To: <1246288762.11688.39.camel@blaa>

Mark McLoughlin wrote:
> Errors are:
> 
>   hw/pcspk.c:85: error: expected declaration specifiers or ‘...’ before ‘kvm_pit_state’
>   hw/pcspk.c:87: error: expected declaration specifiers or ‘...’ before ‘kvm_pit_state’
>   hw/pcspk.c: In function ‘pcspk_callback’:
>   hw/pcspk.c:114: error: too many arguments to function ‘kvm_get_pit_ch2’
>   hw/pcspk.c: In function ‘pcspk_ioport_read’:
>   hw/pcspk.c:161: error: too many arguments to function ‘kvm_get_pit_ch2’
>   hw/pcspk.c: In function ‘pcspk_ioport_write’:
>   hw/pcspk.c:171: error: storage size of ‘inkernel_state’ isn’t known
>   hw/pcspk.c:175: error: too many arguments to function ‘kvm_get_pit_ch2’
>   hw/pcspk.c:185: error: too many arguments to function ‘kvm_set_pit_ch2’
>   hw/pcspk.c:171: warning: unused variable ‘inkernel_state’
> 
> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
> Cc: Jan Kiszka <jan.kiszka@web.de>
> ---
>  hw/pcspk.c |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/pcspk.c b/hw/pcspk.c
> index 9e1b59a..fb823d5 100644
> --- a/hw/pcspk.c
> +++ b/hw/pcspk.c
> @@ -80,11 +80,15 @@ static void kvm_set_pit_ch2(PITState *pit,
>          kvm_set_pit(kvm_context, inkernel_state);
>      }
>  }
> -#else
> +#elif defined(USE_KVM)
>  static inline void kvm_get_pit_ch2(PITState *pit,
>                                     kvm_pit_state *inkernel_state) { }
>  static inline void kvm_set_pit_ch2(PITState *pit,
>                                     kvm_pit_state *inkernel_state) { }
> +#else
> +typedef struct kvm_pit_state { char dummy; } kvm_pit_state;

If you do this...

> +#define kvm_get_pit_ch2(p, s) do { (void)s; } while(0)
> +#define kvm_set_pit_ch2(p, s) do { (void)s; } while(0)

you don't need this.

>  #endif
>  
>  static inline void generate_samples(PCSpkState *s)

Basically that's band aid, but I could live with it for now. A cleaner
approach would be to push the dummy type into (qemu-)kvm.h, ie. the file
responsible for importing the kernel headers in the USE_KVM/CONFIG_KVM case.

Note that qemu-kvm still breaks in the non-kvm build for other reasons
here. I wanted to look into this but got detracted.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

      reply	other threads:[~2009-06-29 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-29 15:19 [PATCH] Fix pcspk build with kvm disabled Mark McLoughlin
2009-06-29 16:00 ` Jan Kiszka [this message]

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=4A48E52A.9060004@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=markmc@redhat.com \
    /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