IP Library › Granted Patent US 10,901,766
Granted Patent B2
US 10,901,766 · App. 16/457,016 · Granted Jan 26, 2021

Method and apparatus for simultaneously running multiple virtual machines, and electronic device

Inventors: Yanfei Wen (Shenzhen, CN); Yonghui Wang (Shenzhen, CN)
G06F9/45545G06F9/5077G06F2009/45579
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,901,766
App. No.
16/457,016
Granted
Jan 26, 2021
Kind
B2
Abstract

The present invention provides a method and apparatus for simultaneously running multiple virtual machines, and an electronic device. The method includes: initiating a request of running a second operating system in QEMU; triggering an exception to a Hypervisor of a currently running first operating system in a KVM module; storing a context of the Hypervisor of the first operating system in the Hypervisor of the first operating system, and loading the context of the Hypervisor of the second operating system; and storing the context of the first operating system in the Hypervisor of the second operating system, and loading the context of the second operating system. By adoption of the solution provided by the present application, multiple virtual machines can be run simultaneously, and the respective functions can be run independently.

Claims (25)

1. A method for simultaneously running multiple virtual machines, comprising:

initiating a request of running a second operating system in QEMU;

triggering an exception to a Hypervisor of a first operating system in a Kernel Virtual Machine (KVM) module, wherein the first operating system is a currently running operating system;

storing a context of the Hypervisor of the first operating system in a storage space of the Hypervisor of the first operating system, and loading a context of a Hypervisor of the second operating system; and

storing the context of the first operating system in a storage space of the Hypervisor of the second operating system, and loading the context of the second operating system, so that the currently running operating system is switched to the second operating system.

2. The method according to claim 1 , further comprising:

when a termination of the running of the second operating system is monitored in the QEMU, storing the context of the second operating system in the Hypervisor of the second operating system, and loading the context of the first operating system;

triggering an exception to the Hypervisor of the second operating system in the KVM module; and

storing the context of the Hypervisor of the second operating system in the storage space of the Hypervisor of the second operating system, and loading the context of the Hypervisor of the first operating system, so that the currently running operating system is switched to the first operating system.

3. The method according to claim 1 , wherein the storing a context of the Hypervisor of the first operating system in a storage space of the Hypervisor of the first operating system, and loading a context of a Hypervisor of the second operating system is specifically as follows: calling back the KVM module in the Hypervisor of the first operating system, storing the context of the Hypervisor of the first operating system in the KVM module, and loading the context of the Hypervisor of the second operating system.

4. The method according to claim 1 , wherein the first operating system is a Host operating system, the Hypervisor of the first operating system is a platform Hypervisor, the second operating system is a Guest operating system, and the Hypervisor of the second operating system is a third-party Hypervisor, wherein the third-party Hypervisor is a Hypervisor other than the platform Hypervisor.

5. The method according to claim 1 , wherein a kernel of the first operating system is a Host Linux kernel, and the kernel of the second operating system is a Guest Linux kernel.

6. An electronic device, comprising: a memory, one or more processors, and one or more modules;

the one or more modules are stored in the memory and are configured to be executed by the one or more processors, and the one or more modules comprise instructions for executing the following steps:

initiating a request of running a second operating system in QEMU;

triggering an exception to a Hypervisor of a first operating system in a Kernel Virtual Machine (KVM) module, wherein the first operating system is currently running operating system;

storing a context of the Hypervisor of the first operating system in a storage space of the Hypervisor of the first operating system, and loading a context of a Hypervisor of the second operating system; and

storing the context of the first operating system in a storage space of the Hypervisor of the second operating system, and loading the context of the second operating system; so that the currently running operating system is switched to the second operating system.

7. The electronic device according to claim 6 , the one or more modules further comprise instructions for executing steps of:

when a termination of the running of the second operating system is monitored in the QEMU, storing the context of the second operating system in the Hypervisor of the second operating system, and loading the context of the first operating system;

triggering an exception to the Hypervisor of the second operating system in the KVM module; and

storing the context of the Hypervisor of the second operating system in the storage space of the Hypervisor of the second operating system, and loading the context of the Hypervisor of the first operating system, so that the currently running operating system is switched to the first operating system.

8. The electronic device according to claim 6 , wherein the storing a context of the Hypervisor of the first operating system in a storage space of the Hypervisor of the first operating system, and loading a context of a Hypervisor of the second operating system is specifically as follows: calling back the KVM module in the Hypervisor of the first operating system, storing the context of the Hypervisor of the first operating system in the KVM module, and loading the context of the Hypervisor of the second operating system.

9. The electronic device according to claim 6 , wherein the first operating system is a Host operating system, the Hypervisor of the first operating system is a platform Hypervisor, the second operating system is a Guest operating system, and the Hypervisor of the second operating system is a third-party Hypervisor, wherein the third-party Hypervisor is a Hypervisor other than the platform Hypervisor.

10. The electronic device according to claim 6 , wherein a kernel of the first operating system is a Host Linux kernel, and a kernel of the second operating system is a Guest Linux kernel.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 6, 2019
From: WEN, YANFEI; WANG, YONGHUI
To: CLOUDMINDS (SHENZHEN) ROBOTICS SYSTEMS CO., LTD.
Reel/Frame 049972/0202 →
Continuity (2)
Continuation PCTCN2016112833 · Dec 29, 2016
Related Publication 20190317785A1 · Oct 17, 2019