From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Gregory Haskins <ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH 2/4] KVM-USER: Make the kvm_allowed flag always defined so we dont need #ifdefs
Date: Mon, 14 May 2007 15:09:07 +0300 [thread overview]
Message-ID: <46485163.9090204@qumranet.com> (raw)
In-Reply-To: <20070511204206.22062.7570.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
Gregory Haskins wrote:
> Non-performance critical code is made more awkward by having to always define
> both "#ifdef KVM" and "if (kvm_allowed)". Define "kvm_allowed = 0" by
> default. Anthony Ligouri is credited with the idea.
>
> Signed-off-by: Gregory Haskins <ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org>
> ---
>
> qemu/qemu-kvm.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/qemu/qemu-kvm.c b/qemu/qemu-kvm.c
> index 212570a..d4419a3 100644
> --- a/qemu/qemu-kvm.c
> +++ b/qemu/qemu-kvm.c
> @@ -3,6 +3,14 @@
> #include "config-host.h"
>
> #ifdef USE_KVM
> + #define KVM_ALLOWED_DEFAULT 1
> +#else
> + #define KVM_ALLOWED_DEFAULT 0
> +#endif
You could do a
#ifndef USE_KVM
#define kvm_allowed 0
#else
extern int kvm_allowed
#endif
However, will the code actually compile ifndef USE_KVM? Suppose the
headers aren't installed?
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
next prev parent reply other threads:[~2007-05-14 12:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-11 20:41 [PATCH 0/4] in-kernel APIC v3a (usermode side) Gregory Haskins
[not found] ` <20070511203316.22062.4417.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-05-11 20:42 ` [PATCH 1/4] KVM: Updates for compiling in-kernel APIC support with external-modules Gregory Haskins
2007-05-11 20:42 ` [PATCH 2/4] KVM-USER: Make the kvm_allowed flag always defined so we dont need #ifdefs Gregory Haskins
[not found] ` <20070511204206.22062.7570.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-05-14 12:09 ` Avi Kivity [this message]
2007-05-11 20:42 ` [PATCH 3/4] KVM-USER: Add ability to specify APIC emulation type from the command-line Gregory Haskins
2007-05-11 20:42 ` [PATCH 4/4] KVM: in-kernel-apic modification to QEMU Gregory Haskins
[not found] ` <20070511204216.22062.97272.stgit-sLgBBP33vUGnsjUZhwzVf9HuzzzSOjJt@public.gmane.org>
2007-05-11 20:52 ` Anthony Liguori
[not found] ` <4644D7AB.5040309-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-05-11 21:20 ` Gregory Haskins
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=46485163.9090204@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=ghaskins-Et1tbQHTxzrQT0dZR+AlfA@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
/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