/DEV/KVM Simple Comprehension

Source: Internet
Author: User

What the hell is/DEV/KVM?

1./DEV/KVM device is a device file that comes out of a KVM (kernel-based virtual machine) VM

2. Speaking of KVM, we have to mention that Qemu,qemu is a simulation software that runs on Linux user space. QEMU can simulate all the operating systems we can see, such as simulating Andrio,ios on the x86 platform, and, of course, simulating windows,linux (GNU), BSD. Because of the simulation of the system virtualization, it produces all the CPU instructions are translated once, so its performance is very low.

3. So what's the problem, what does KVM offer? In fact, KVM only provides three modules, respectively, is Kvm.ko,kvm_intel.ko,kvm_amd.ko, the latter two modules are based on the physical host of the CPU-owned manufacturers automatically match.

4. As you know, QEMU is a user-space program, and KVM is a program that runs in kernel space. To provide a holistic solution (including the user space Toolset [provided by QEMU] to manage a variety of devices (provided by the KVM Kernel module)), the KVM development team borrowed the QEMU code and made some modifications to form a set of tools, i.e. QEMU-KVM (not commands in Linux)

5. How to combine qemu with a KVM kernel module, the/DEV/KVM is working. /DEV/KVM is a character device, and when Qemu opens the device, the three abstract objects provided by the KVM module can be obtained through the IOCTL system call:

KVM: Represents the KVM module itself for managing KVM version information, creating a VM (via)

VM: Represents a virtual machine. VM Io_ctl interface allows you to create vcpus for virtual machines, set memory intervals, create interrupt control chips, allocate interrupts, and more

Vcpus: Represents an Vcpus. With the Io_ctl interface of Vcpus, you can start or pause the Vcpus, set the register of Vcpus, inject interrupts for Vcpus, etc.

How QEMU is used:

1. Turn on the/DEV/KVM device

2. Create a virtual machine object from KVM_CREATE_VM

3. Create an Vcpus object for a virtual machine via KVM_CREATE_VCPU

4. Set up Vcpus to run with Kvm_run

6.SO,/DEV/KVM is just an interface provided by the KVM kernel module to the user space, which is called by QEMU-KVM and can be used to provide a tool for creating, deleting, managing virtual machines, etc. via the IOCTL system.


This article is from the "Silent" blog, please be sure to keep this source http://1054383.blog.51cto.com/1044383/1664143

/DEV/KVM Simple Comprehension

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.