Monday, October 28, 2013

QEMU Source Code Study (2) - KVM_init

At first, main() in vl.c will call configure_accelerator()




QEMU Part



configure_accelerator()


  • accel_list[]

  • kvm_init()


  • KVMState
  • kvm_ioctl(KVMState *s, int type, ...)



  • KVM Part



    Register ioctl handler


    vmx_init() -> kvm_init(...) -> misc_register(kvm_dev) -> kvm.&kvm_chardev_ops
  • kvm_dev
  • kvm_chardev_ops

  • KVM API




    The "/dev/kvm" ioctl handler is as follows:
  • KVM_GET_API_VERSION
  • This API just return the API version of KVM. The handler just return he version of KVM. This parameter is defined in ./include/uapi/linux/kvm.h
  • KVM_CREATE_VM
  • This API is used by QEMU to ask KVM create VM. "KVM_CREATE_VM" definition is the same as KVM_GET_API_VERSION.

    No comments:

    Post a Comment