From: Paolo Bonzini <pbonzini@redhat.com>
To: "\"陳韋任 (Wei-Ren Chen)\"" <chenwj@iis.sinica.edu.tw>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Does kvm_fd mean KVM or VCPU fd?
Date: Thu, 14 Jun 2012 11:15:06 +0200 [thread overview]
Message-ID: <4FD9AB9A.4080401@redhat.com> (raw)
In-Reply-To: <20120614082444.GA1692@cs.nctu.edu.tw>
Il 14/06/2012 10:24, 陳韋任 (Wei-Ren Chen) ha scritto:
> Hi all,
>
> While reading KVM releated code in QEMU, I found the name of one
> field in CPU_COMMON (cpu-defs.h), i.e. kvm_fd, might be misleading.
> See the code below,
>
> ---
> int kvm_init_vcpu(CPUArchState *env)
> {
> ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index);
> env->kvm_fd = ret; /* VCPU fd? */
> }
> ---
>
> I think KVM_CREATE_VCPU should return VCPU fd, right? AFAIK, in KVM
> world, kvm_fd usually means the fd we get after opening "/dev/kvm".
> Just want to make sure I understand the code correcly. Thanks.
This is the kvm_fd inside struct CPUState, so it's per-CPU.
Paolo
next prev parent reply other threads:[~2012-06-14 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-14 8:24 [Qemu-devel] Does kvm_fd mean KVM or VCPU fd? 陳韋任 (Wei-Ren Chen)
2012-06-14 9:15 ` Paolo Bonzini [this message]
2012-06-14 10:16 ` 陳韋任 (Wei-Ren Chen)
2012-06-14 14:49 ` Andreas Färber
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=4FD9AB9A.4080401@redhat.com \
--to=pbonzini@redhat.com \
--cc=chenwj@iis.sinica.edu.tw \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).