From: Paolo Bonzini <pbonzini@redhat.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 1/2] Move KVM init to arch_init.c, compile vl.c once
Date: Thu, 01 Apr 2010 22:23:29 +0200 [thread overview]
Message-ID: <4BB500C1.1020600@redhat.com> (raw)
In-Reply-To: <l2vf43fc5581004011307m28f5f783nc27e4350acedef81@mail.gmail.com>
On 04/01/2010 10:07 PM, Blue Swirl wrote:
> Remove dependency of vl.c to KVM, then we can partially revert
> b33612d03540fda7fa67485f1c20395beb7a2bf0.
This is ugly...
Michael Tsirkin said in commit ca821806:
Comment on kvm usage: rather than require users to do if(kvm_enabled())
and/or ifdefs, this patch adds an API that, internally, is defined to
stub function on non-kvm build, and checks kvm_enabled for non-kvm
run.
While rest of qemu code still uses if (kvm_enabled()), I think this
approach is cleaner, and we should convert rest of code to it
long term.
Maybe we can start doing this for kvm_init?
> +void enable_kvm(void)
> +{
> + kvm_allowed = 1;
> +}
If you're adding this, this conditional from vl.c
if (!(kvm_available())) {
printf("Option %s not supported for this target\n", popt->name);
exit(1);
}
belongs in arch_init.c too, like in do_smbios_option and
do_acpitable_option.
Alternatively, with the approach I gave above, you can test in
kvm_maybe_init if kvm_init returns -ENOSYS, and print the error above
instead of "failed to initialize KVM".
Paolo
next prev parent reply other threads:[~2010-04-01 20:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-01 20:07 [Qemu-devel] [PATCH 1/2] Move KVM init to arch_init.c, compile vl.c once Blue Swirl
2010-04-01 20:15 ` Anthony Liguori
2010-04-01 20:27 ` Blue Swirl
2010-04-02 15:01 ` [Qemu-devel] " Paolo Bonzini
2010-04-02 15:08 ` Anthony Liguori
2010-04-02 15:11 ` Paolo Bonzini
2010-04-02 15:20 ` Anthony Liguori
2010-04-02 16:01 ` Paolo Bonzini
2010-04-02 15:43 ` Blue Swirl
2010-04-01 20:23 ` Paolo Bonzini [this message]
2010-04-02 14:20 ` Blue Swirl
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=4BB500C1.1020600@redhat.com \
--to=pbonzini@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.