static struct file_operations kvm_vm_fops = { .release = kvm_vm_release, .unlocked_ioctl = kvm_vm_ioctl, #ifdef CONFIG_KVM_COMPAT .compat_ioctl = kvm_vm_compat_ioctl, #endif .llseek = noop_llseek, }; static long kvm_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg...
KVMPITState *s = KVM_PIT(pit);structkvm_pit_state2kpit;structkvm_pit_channel_state*kchan;structPITChannelState*sc;inti, ret;/* No need to re-read the state if VM is stopped. */if(s->vm_stopped) {return; }if(kvm_has_pit_state2()) { ret =kvm_vm_ioctl(kvm_state, KVM_GET_PI...
1.3. KVM概述之API 描述符来控制虚拟机的行为。通过KVM_CREATE_VCPU指令,将创建一个虚拟CPU并且返回该vCPU对应的fd。 需要注意的一点是,在Linux的系统调用中,通过fork()系统调用创建的子..._VCPU是vmioctl系统调用的两个重要指令字。在通过KVM_CREATE_VCPU为VM虚拟机创建vCPU,并且获得 vCPU对应的fd文件描述符!!