Virtual machine starting sequence control method, system and device and storage medium

By setting the status bit in the virtual machine manager to control the initialization status of the semi-virtualized peripheral, the problem of the unavailability of the peripheral is solved by starting the ordinary virtual machine first, and the normal virtual machine and the privileged virtual machine are enabled at the same time or first, reducing the startup time and ensuring the normal operation of the peripheral.

CN120066673APending Publication Date: 2025-05-30RESIDE (SHANGHAI) INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411958015.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the implementation of a semi-virtualized peripheral, when an ordinary virtual machine starts first than a privileged virtual machine, it may cause the front-end peripheral to be unusable or the ordinary virtual machine to crash. The ordinary virtual machine must be started after the privileged virtual machine is started, resulting in a long boot time.

Method used

By setting the status bit of the semi-virtualized peripheral backend initialization status in the virtual machine manager, ordinary virtual machines and privileged virtual machines are allowed to start at the same time, or ordinary virtual machines are started first. The specific method includes setting the status bit in the virtual machine manager and initializing, starting the second virtual machine and initializing the semi-virtualized peripheral backend, then starting the first virtual machine and querying the status bit, loading the front-end driver if it has been initialized, otherwise continuing to wait.

Benefits of technology

It realizes that ordinary virtual machines and privileged virtual machines are started at the same time or first, reducing startup time and ensuring that front-end peripherals can be used normally.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066673A_ABST
    Figure CN120066673A_ABST
Patent Text Reader

Abstract

According to the control method for the starting sequence of the virtual machines, the state bit is set in the virtual machine manager to obtain the initialization state of the privileged virtual machine so as to dynamically adjust starting of the common virtual machine, the common virtual machine and the privileged virtual machine can be started at the same time in the implementation of the para-virtualization peripheral, and the starting sequence of the common virtual machine and the privileged virtual machine is controlled. Or the common virtual machine is started earlier than the privileged virtual machine, so that the starting time of the common virtual machine is shortened, and meanwhile, normal use of the front-end peripheral can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to virtual machine technology, and particularly to a method, system, device and storage medium for controlling the startup sequence of virtual machines. Background Art

[0002] In the implementation of para-virtualized peripherals, the backend of the para-virtualized peripherals may be implemented in a privileged virtual machine. Since the front-end driver of the para-virtualized peripherals runs in a normal virtual machine, if the normal virtual machine starts up before this privileged virtual machine, the front-end peripherals may not be available because the backend has not been initialized yet, and it may even cause the normal virtual machine to crash. To solve this problem, it is usually necessary to wait for the privileged virtual machine to start up completely before starting the normal virtual machine, but this causes the problem that the startup time of the normal virtual machine is too long.

[0003] The present invention introduces a method in which, in this case, the normal virtual machine can start up simultaneously with or even before the privileged virtual machine, thereby reducing the startup time while ensuring that the front-end peripherals can be used normally and the front-end virtual machine runs normally. Summary of the Invention

[0004] To solve the above technical problems, the present invention provides a method, system, device and storage medium for controlling the startup sequence of virtual machines.

[0005] The present invention is achieved through the following technical solutions.

[0006] A method for controlling the startup sequence of virtual machines provided by the present invention includes the following steps:

[0007] Set a status bit in the virtual machine manager and set its initial status to uninitialized;

[0008] Start the second virtual machine and start the backend of the para-virtualized peripherals. When the initialization of the backend of the para-virtualized peripherals is completed, set the status bit to initialized;

[0009] Start the first virtual machine. The operating system or startup program queries the status of the status bit from the virtual machine manager. If the status is initialized, load the front-end driver of the first virtual machine; if the status is uninitialized, the first virtual machine continues to wait until the status bit is set to initialized.

[0010] Further, the second virtual machine can be started before or after the first virtual machine.

[0011] Further, the method for starting the second virtual machine and starting the backend of the para-virtualized peripherals includes:

[0012] Start the para-virtualized peripheral backend service program. After startup, the service program communicates with the para-virtualized peripheral backend kernel module, and the para-virtualized peripheral backend kernel module sends the current status to the virtual machine manager, which stores the received data in the status bit.

[0013] Furthermore, the method for starting the first virtual machine includes:

[0014] Before loading the driver, the para-virtualized front-end driver in the first virtual machine queries the status bit in the virtual machine manager to obtain the initialization status of the current second virtual machine. If the status is set to uninitialized, the first virtual machine continues to wait; if the status is initialized, the para-virtualized front-end driver in the first virtual machine is loaded, and the front-end peripherals work properly.

[0015] Furthermore, if the status is uninitialized, the method for the first virtual machine to continue waiting until the status bit is set to initialized includes:

[0016] The user configures the query time interval and number of times by themselves. The first virtual machine queries according to the time interval and number of times configured by the user, and processes according to the user's configuration if the query result is still in the uninitialized state.

[0017] The present invention also includes a control system for the virtual machine startup sequence, including a first virtual machine, a second virtual machine, and a virtual machine manager. A status bit is provided in the virtual machine manager, and the first virtual machine and the second virtual machine communicate with the virtual machine manager through a bus respectively.

[0018] Furthermore, the first virtual machine includes a para-virtualized peripheral backend and a para-virtualized backend kernel module. The para-virtualized peripheral backend communicates with the para-virtualized backend kernel module, and the para-virtualized backend kernel module communicates with the virtual machine manager.

[0019] Furthermore, the second virtual machine includes an application layer and a para-virtualized front-end driver. The application layer communicates with the para-virtualized front-end driver, and the para-virtualized front-end driver communicates with the virtual machine manager.

[0020] The present invention also includes a control device for the virtual machine startup sequence, including a module for executing the method described in any one of the above, including a processor and an interface circuit. The interface circuit is used to receive signals from other devices outside the device for executing kernel-mode commands and transmit them to the processor, or send signals from the processor to other devices outside the device for executing kernel-mode commands. The processor uses logic circuits or executes code instructions to implement the method described in any one of the above.

[0021] The present invention also includes a computer-readable storage medium, on which a computer program is stored. The computer program, when executed by a processor, implements the method described in any one of the above.

[0022] The beneficial effects of the present invention are as follows: By setting the status bit of the initialization state of the para-virtualized peripheral backend in the virtual machine manager, the present invention can achieve that in the implementation of the para-virtualized peripheral, the ordinary virtual machine and the privileged virtual machine can be started simultaneously, or the ordinary virtual machine can be started earlier than the privileged virtual machine, reducing the startup time of the ordinary virtual machine and ensuring that the front-end peripheral can be used normally at the same time. Brief Description of the Drawings

[0023] Figure 1 is a schematic diagram of the system connection relationship of the present invention;

[0024] Figure 2 is a flowchart of the method of the embodiment of the present invention. Detailed Embodiments

[0025] The technical solution of the present invention will be further described below, but the scope of protection is not limited thereto.

[0026] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be described in detail below with reference to the drawings and specific embodiments.

[0027] Embodiment

[0028] The first virtual machine 100 and the second virtual machine 200 described in the present application are run in an embedded device, where the first virtual machine 100 is used as the privileged virtual machine in this embodiment, and is internally provided with a para-virtualized peripheral backend and a para-virtualized backend kernel module. The para-virtualized peripheral backend communicates with the para-virtualized backend kernel module, and the para-virtualized backend kernel module communicates with the virtual machine manager 300; the second virtual machine 200 is used as an ordinary virtual machine, which is provided with an application layer and a para-virtualized front-end driver. The application layer communicates with the para-virtualized front-end driver, and the para-virtualized front-end driver communicates with the virtual machine manager 300. After the embedded device is powered on, the status bit of the virtualization manager 300 saves the startup state of the para-virtualized peripheral backend and sets it to the "uninitialized" state. After the embedded device starts to work, the first virtual machine 100 synchronously transmits the current initialization state of the para-virtualized peripheral backend to the virtual machine manager 300 in real time. When the second virtual machine 200 starts, its operating system or driver queries the initialization state of the para-virtualized peripheral backend of the status bit from the virtual machine manager 300. If the status bit is queried as "initialized", the second virtual machine 200 loads the para-virtualized front-end driver and the front-end peripheral works normally; if the status queried is "uninitialized", the second virtual machine 200 continues to wait for the query time interval configured by the user and queries the status bit again until the status changes to "initialized".

[0029] The above embodiments are the preferred solutions for the implementation of the present invention. It should be noted that any obvious substitutions and minor changes are within the protection scope of the present invention without departing from the concept of the present invention.

Claims

1. A method for controlling the startup sequence of a virtual machine, characterized in that: include: Setting a status bit in the virtual machine manager 300 and setting the initial status to uninitialized; Start the second virtual machine 200, and start the paravirtualized peripheral backend, and when the paravirtualized peripheral backend is initialized, the status bit is set to initialized; The first virtual machine 100 is started, and the operating system or the startup program queries the virtual machine manager 300 for the state of the state bit. If the state is initialized, the front-end driver of the first virtual machine 100 is loaded; If the state is uninitialized, the first virtual machine 100 continues to wait for the state to be initialized.

2. The method for controlling the startup sequence of virtual machines according to claim 1, characterized in that: The second virtual machine 200 is started before the first virtual machine 100 is started or the second virtual machine 200 is started after the first virtual machine 100 is started.

3. The method for controlling the startup sequence of virtual machines according to claim 1, characterized in that: The method of starting the second virtual machine 200 and starting the paravirtualized peripheral backend includes: The paravirtualized peripheral backend service program is started, and after the service program is started, it communicates with the paravirtualized peripheral backend kernel module, and the paravirtualized peripheral backend kernel module sends the current state to the virtual machine manager 300, and the virtual machine manager 300 stores the received data in the state bit.

4. The method for controlling the startup sequence of virtual machines according to claim 1, characterized in that: The method for starting the first virtual machine 100 includes: Before loading the driver, the semi-virtualized front-end driver in the first virtual machine 100 queries the status bit in the virtual machine manager 300 to obtain the initialization status of the current second virtual machine 200. If the status is set to uninitialized, the first virtual machine 100 continues to wait; if the status is initialized, the semi-virtualized front-end driver in the first virtual machine 100 is loaded, and the front-end peripherals work normally.

5. The method for controlling the startup sequence of virtual machines according to claim 1, characterized in that: If the state is uninitialized, the method for the first virtual machine 100 to continue waiting for the state position to be initialized includes: The user configures the query time interval and number of times, and the first virtual machine 100 performs queries according to the time interval and number of times configured by the user. If the query result is still in an uninitialized state, it is processed according to the user's configuration.

6. A control system for virtual machine startup sequence, characterized in that: The system comprises a first virtual machine 100, a second virtual machine 200, and a virtual machine manager 300. The virtual machine manager 300 is provided with a status bit. The first virtual machine 100 and the second virtual machine 200 communicate with the virtual machine manager 300 through a bus respectively.

7. The control system for the virtual machine startup sequence according to claim 6, characterized in that: The first virtual machine 100 includes a paravirtualized peripheral backend and a paravirtualized backend kernel module. The paravirtualized peripheral backend communicates with the paravirtualized backend kernel module, and the paravirtualized backend kernel module communicates with the virtual machine manager 300 .

8. The control system for the virtual machine startup sequence according to claim 6, characterized in that: The second virtual machine 200 includes an application layer and a paravirtualized front-end driver. The application layer communicates with the paravirtualized front-end driver, and the paravirtualized front-end driver communicates with the virtual machine manager 300 .

9. A device for controlling the startup sequence of a virtual machine, comprising a module for executing the method according to any one of claims 1 to 5, characterized in that: It includes a processor and an interface circuit, wherein the interface circuit is used to receive signals from other devices other than the device for executing kernel mode commands and transmit them to the processor or send signals from the processor to other devices other than the device for executing kernel mode commands, and the processor is used to implement the method as described in any one of claims 1 to 5 through logic circuits or execution code instructions.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.