From: "David S. Ahern" <daahern@cisco.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] qemu-kvm: Fix boot CPU setup for the case it is unsupported
Date: Thu, 04 Mar 2010 09:07:49 -0700 [thread overview]
Message-ID: <4B8FDAD5.1000006@cisco.com> (raw)
In-Reply-To: <4B8F7690.4040600@web.de>
On 03/04/2010 02:00 AM, Jan Kiszka wrote:
> Commit 52b03dd702 incorrectly failed KVM initialization in case the
> kernel did not support KVM_CAP_SET_BOOT_CPU_ID. Fix this, and also
> improve error propagation of kvm_create_context at this chance.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>
> OK, it really was me. :)
>
> qemu-kvm-x86.c | 9 +++++++--
> qemu-kvm.c | 4 +++-
> 2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c
> index 7a5925a..7d42fdc 100644
> --- a/qemu-kvm-x86.c
> +++ b/qemu-kvm-x86.c
> @@ -672,7 +672,7 @@ static const VMStateDescription vmstate_kvmclock= {
>
> int kvm_arch_qemu_create_context(void)
> {
> - int i;
> + int i, r;
> struct utsname utsname;
>
> uname(&utsname);
> @@ -696,7 +696,12 @@ int kvm_arch_qemu_create_context(void)
> vmstate_register(0, &vmstate_kvmclock, &kvmclock_data);
> #endif
>
> - return kvm_set_boot_cpu_id(0);
> + r = kvm_set_boot_cpu_id(0);
> + if (r < 0 && r != -ENOSYS) {
> + return r;
> + }
> +
> + return 0;
> }
>
> static void set_msr_entry(struct kvm_msr_entry *entry, uint32_t index,
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 222ca97..e417f21 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -2091,8 +2091,10 @@ static int kvm_create_context(void)
> return -1;
> }
> r = kvm_arch_qemu_create_context();
> - if (r < 0)
> + if (r < 0) {
> kvm_finalize(kvm_state);
> + return -1;
> + }
> if (kvm_pit && !kvm_pit_reinject) {
> if (kvm_reinject_control(kvm_context, 0)) {
> fprintf(stderr, "failure to disable in-kernel PIT reinjection\n");
>
Works for me: FC12 host, FC12 guest.
David
prev parent reply other threads:[~2010-03-04 16:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-04 9:00 [PATCH] qemu-kvm: Fix boot CPU setup for the case it is unsupported Jan Kiszka
2010-03-04 16:07 ` David S. Ahern [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=4B8FDAD5.1000006@cisco.com \
--to=daahern@cisco.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@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 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.