[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Does kvm_fd mean KVM or VCPU fd?
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] Does kvm_fd mean KVM or VCPU fd? |
Date: |
Thu, 14 Jun 2012 11:15:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
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