Method and apparatus for managing virtual machine, device, and storage medium

By adding virtualization components and management components to the kernel, managing shared virtualization resources and handling interrupts, the problem of high operation and maintenance costs of virtualization components is solved, and the thermal upgrade and reliable management of virtual machines are achieved.

WO2025113399A1PCT designated stage expired Publication Date: 2025-06-05BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/134358
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-28
Filing Date
2024-11-25
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

In a production environment with large-scale deployment, the operation and maintenance of virtualized components is an important issue, especially when virtualized components cannot update their functions in a timely manner, resulting in high operation and maintenance costs.

Method used

By adding multiple virtualization components and management components to the kernel, the management component is used to manage shared virtualization resources for virtualization components. If an interrupt for a virtual machine is triggered, the global interrupt processing function corresponding to the management component is called, and the interrupt processing function corresponding to the virtualization component that creates the virtual machine is determined through the global interrupt processing function, and the interrupt processing function is called to handle the interrupt.

Benefits of technology

It realizes thermal upgrade and reliable management of virtual machines, avoids resource conflicts and security issues, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024134358_05062025_PF_FP_ABST
    Figure CN2024134358_05062025_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure provide a method and apparatus for managing a virtual machine, a device, and a storage medium. The method comprises: in response to triggering an interrupt for a virtual machine, calling a global interrupt processing function corresponding to a management component, wherein the management component is configured to manage shared virtualized resources of a plurality of virtualization components; by means of the global interrupt processing function, determining a first interrupt processing function corresponding to a first virtualization component, wherein the virtual machine is created by the first virtualization component; and calling the first interrupt processing function to process the interrupt. In this way, different virtualization components can be coordinated to avoid resource conflicts or errors, thereby facilitating implementing a hot upgrade and reliable virtual machine management.
Need to check novelty before this filing date? Find Prior Art

Description

Method, apparatus, device and storage medium for managing virtual machines

[0001] This application claims priority to the Chinese invention patent application entitled “Methods, apparatus, devices and storage media for managing virtual machines” and application number 202311607866.4, filed on November 28, 2023. The entire contents of that application are incorporated by reference into this application. Technical Field

[0002] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, apparatuses, devices, and computer-readable storage media for managing virtual machines. Background Art

[0003] With the development of computer technology, cloud computing has become widely used. Virtualization, as one of the key fundamental functions of cloud computing, has a wide range of applications. Virtualization components based on various suitable technologies provide virtual machines with high-performance resources such as processor resources, memory resources, and input / output (IO) resources. In large-scale production deployments, the operation and maintenance of virtualization components is a key concern for cloud service providers. Summary of the Invention

[0004] In a first aspect of the present disclosure, a method for managing a virtual machine is provided. The method comprises: in response to an interrupt being triggered for the virtual machine, calling a global interrupt handler corresponding to a management component, the management component being used to manage shared virtualized resources of multiple virtualization components; determining, through the global interrupt handler, a first interrupt handler corresponding to a first virtualization component, the virtual machine being created by the first virtualization component; and calling the first interrupt handler to handle the interrupt.

[0005] In a second aspect of the present disclosure, a device for managing a virtual machine is provided. The device includes: a first calling module configured to, in response to an interrupt being triggered for the virtual machine, call a global interrupt handling function corresponding to a management component, the management component being used to manage shared virtualized resources of multiple virtualization components; a processing function determination module configured to determine, through the global interrupt handling function, a first interrupt handling function corresponding to a first virtualization component, the virtual machine being created by the first virtualization component; and a second calling module configured to call the first interrupt handling function to handle the interrupt.

[0006] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit. When executed by the at least one processing unit, the instructions cause the device to perform the method of the first aspect.

[0007] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0008] It should be understood that the content described in this summary section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0010] FIG1 shows a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented;

[0011] FIG2 is a schematic diagram showing an example of updating a virtualization component;

[0012] FIG3 shows a schematic diagram of an example architecture for managing virtual machines according to some embodiments of the present disclosure;

[0013] FIG4 shows a schematic diagram of processing an interruption to a virtual machine according to some embodiments of the present disclosure;

[0014] FIG5 shows a flowchart of a process for managing virtual machines according to some embodiments of the present disclosure;

[0015] FIG6 shows a block diagram of an apparatus for managing virtual machines according to some embodiments of the present disclosure; and

[0016] FIG7 shows a block diagram of a device capable of implementing various embodiments of the present disclosure. DETAILED DESCRIPTION

[0017] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0018] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.

[0019] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0020] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0021] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.

[0022] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be noted that the titles of any section / subsection provided herein are not limiting. Various embodiments are described throughout this document, and any type of embodiment may be included under any section / subsection. Furthermore, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or in different sections / subsections.

[0024] Herein, unless explicitly stated otherwise, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.

[0025] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.

[0026] FIG1 illustrates a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. In environment 100, a virtualization component 110 is deployed in a kernel 101 of an electronic device, which can utilize various resources of the electronic device to create and run virtual machines, such as virtual machine 120. Resources may include, but are not limited to, processor resources (e.g., central processing unit, CPU), memory resources, IO resources, etc. By way of example and without intending any limitation, virtualization component 110 may be a kernel-based virtual machine (KVM) module.

[0027] As shown in FIG1 , in some embodiments, the environment 100 may further include an emulator 130 located between the virtual machine 120 and the virtual machine component 130. The emulator 130 may be used to simulate various virtual devices (such as a network card, a graphics card, a storage controller, and a hard disk) required to "assemble" a complete virtual machine. As an example and without any limitation, the emulator 130 may be a quick emulator (QEMU). It will be understood that the virtualization component 110 is in kernel space, while the emulator 130 is in user space.

[0028] As briefly mentioned above, the operation and maintenance of virtualization components in large-scale production environments is a major concern for cloud service providers. To provide efficient, secure, and stable cloud resources to cloud service users, virtualization components are expected to support various operational requirements. For example, once security vulnerabilities or functional defects in virtualization components are fixed by developers, they can be promptly deployed to production environments through hot upgrades.

[0029] An example of a hot upgrade process is described with reference to FIG2 . As shown in FIG2 , before the upgrade, virtual machine 221 runs using simulator 231 and virtualization component 211 in kernel 201. During the upgrade, an updated simulator 232 is deployed and the updated virtualization component 212 is inserted into kernel 201. Then, using the updated simulator 232, a virtual machine 222 with the same specifications as virtual machine 221 can be launched on the updated virtualization component 212. The updated simulator 232 synchronizes the virtual machine state with the coil simulator 231. Afterwards, the previous virtual machine 221 can be shut down. This allows for a hot upgrade of the virtual machine, i.e., running the virtual machine on the updated virtualization component 212 and simulator 232.

[0030] However, in some computing systems, virtualization components are built-in modules of the kernel and cannot be compiled or replaced independently. This results in the virtualization components running in such computing systems being unable to promptly and effectively update functional defects. Updates can only be made by migrating to other physical machines with updated kernels. This undoubtedly significantly increases operational costs.

[0031] In some solutions, the virtualization component can be compiled separately as a module that can be plugged into the kernel, and the kernel can have multiple such virtualization components. However, the insertion of multiple virtualization components may bring new problems, such as conflicts in virtualization resources.

[0032] Embodiments of the present disclosure provide a solution for managing virtual machines. According to various embodiments of the present disclosure, multiple virtualization components and management components for these virtualization components can be added to the kernel. The management component is used to manage the shared virtualization resources of these virtualization components, such as processor resources, memory resources, I / O resources, and so on. If an interrupt is triggered for a virtual machine, the global interrupt handling function corresponding to the management component is called. The global interrupt handling function determines the interrupt handling function corresponding to the virtualization component that created the virtual machine. This interrupt handling function is then called to handle the interrupt.

[0033] In the embodiments of the present disclosure, hot upgrades are implemented using virtual machine components that can be added to the kernel. Furthermore, management components are used to manage interrupts for different virtualized components. This allows coordination between different virtualized components to avoid resource conflicts or errors. This facilitates hot upgradeable and reliable virtual machine management.

[0034] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with continued reference to the accompanying drawings.

[0035] FIG3 shows an example architecture 300 for managing virtual machines according to some embodiments of the present disclosure. As shown in FIG3 , in some embodiments, if the kernel includes a built-in virtualization component 302, virtualization components 310-1, 310-2, and 310-3 can be generated based on the built-in virtualization component 302, which are also collectively or individually referred to as virtualization components 310. In addition, a management component 315 is also generated to manage the shared virtualization resources of these virtualization components 310. For example, the code related to the built-in virtualization component 302 in the kernel can first be extracted from the kernel, and a compilation script can be added to it so that it can be compiled into a module that can be inserted into the kernel in user mode. Then, a public resource management module, i.e., the management component 315, can be added to the source code.

[0036] The following uses the KVM module as an example of a virtualization component to describe the generation of virtualization components and management components. Code extraction and compilation includes three parts: C code, header files, and adding compilation scripts. First, extract the C code and header files related to KVM. Arrange the extracted code to place the C code and header files in their respective designated directories. Then, add a compilation script to compile the KVM module. In order to compile and insert multiple KVM modules, a macro for identifying the KVM module can be added to the compilation script, for example, it can be identified by KVM_INDEX. KVM_INDEX can be increased by one for each KVM module compiled. This macro can be used to use different sub-device numbers and distinguish each other when the KVM module is subsequently registered with the kernel.

[0037] It should be understood that the virtualization component and management component generation process described above with reference to the KVM module is only exemplary. Depending on the virtualization technology used, these components can be generated in any suitable manner.

[0038] Virtualization component 310 and management component 315 can be added to kernel 301. For example, these components can be loaded into kernel 301 via insmod. Management component 315 and these virtualization components 310 can run on any suitable computing system. In some embodiments, management component 315 and these virtualization components 310 can run on a computing system that originally has a built-in virtualization component, such as a computing system based on an advanced reduced instruction set architecture.

[0039] As the number of virtualization components increases from one to multiple, resource duplication arises. This duplication of resources leads to waste. In particular, the sharing of critical resources can create serious security issues. For example, if the virtual machine identifier (VMID), used to distinguish address spaces between different virtual machines, is shared, different virtualization components may create virtual machines using the same VMID. This allows different virtual machines to access each other's address spaces, creating security issues. By using a common resource management module (i.e., a management component) to manage shared resources between different modules, resource waste and security issues can be avoided.

[0040] The shared virtualization resources managed may include resources of any suitable type and suitable resource unit. For example, shared virtualization resources may include VMID, generation identifier VMID_GEN for distinguishing different generations of VMID, virtual CPU resources, interrupt resources, etc. Interrupt resources may include, for example, timer interrupts, general interrupt controller (GIC) maintenance interrupts, etc. These resources are extracted from the original virtual machine components into the management component 315 for management and maintenance. When accessing these shared resources, specific synchronization mechanisms, such as locks, may be added to ensure that these resources can be used safely between virtualization components. When the management component 315 is added to the kernel, a flag may be used to "open" the shared resources to each virtualization component. Therefore, the management component 315 may be added to the kernel 301 before the virtualization component 310.

[0041] After the management component 315 and the virtualization component 310 are added to the kernel 301, these components can be used to create and maintain virtual machines. FIG3 exemplarily shows a virtual machine 320 created by the virtualization component 310-2 and supported by the simulator 330.

[0042] After the resources originally in each virtualization component 310 are extracted to the management component 315, the use of these shared resources also needs to be adjusted accordingly. In some embodiments, if a predetermined type of resource in the shared virtualization resources is used by a certain virtualization component 310, the used resource can be disabled for other virtualization components other than the virtualization component. That is, the used resource can be locked to prevent other virtualization components from using the resource. This predetermined type of resource can be a resource that needs to maintain value uniqueness between various virtualization components. For example, a lock can be used when accessing such a resource to ensure the uniqueness of its value between various virtualization components 310. Taking VMID as an example, if a VMID is used by virtualization component 310-1 to create a virtual machine, the management component 315 can apply a lock mechanism to the VMID to prevent virtualization component 310-2 and virtualization component 310-3 from using the VMID.

[0043] Compared to other types of virtualized resources, interrupt resources have their own particularities. In the embodiment of the present disclosure, the interrupts and interrupt handling functions required by the virtualization component 310 can be registered and managed by the common management component 315. The following diagram of handling interrupts for virtual machines is described with reference to FIG4 and in conjunction with FIG3.

[0044] When the virtualization component 310 is added to the kernel 301, the corresponding interrupt handling function can be registered. When each virtualization component 310 is added to the kernel 301, the virtualization component 310 can interact with the management component 315 to add the corresponding interrupt handling function to the interrupt handling function set 401 (e.g., an interrupt handling function list). The interrupt handling function set 401 can include the interrupt handling functions corresponding to the various virtualization components registered with the kernel 301. In the example of Figure 4, the interrupt handling function set 401 includes interrupt handling functions 410-1, 410-2 and 410-3 corresponding to the virtualization components 310-1, 310-2 and 310-3, respectively, which are also collectively or individually referred to as interrupt handling functions 410.

[0045] Accordingly, the management component 315 as a public resource management module may have a corresponding global interrupt handling function 415. In some embodiments, in response to the management component 315 being added to the kernel 301, the management component 315 may register the global interrupt handling function 415 with the kernel 301.

[0046] In some embodiments, registration of the global interrupt handler 415 may be associated with the addition of a virtualization component 310. For example, when the first virtualization component 310 managed by the management component 315 is added to the kernel 301, the management component 315 registers the global interrupt handler 415 with the kernel 301.

[0047] In other words, in this embodiment, when each virtualization component 310 is added to the kernel 301, it can be determined whether the kernel 301 has other virtualization components managed by the management component 315. If other virtualization components exist, it means that the virtualization component 310 is not the first virtualization component added to the kernel 301. Accordingly, only the corresponding interrupt handling function 410 is added to the interrupt handling function set 401. If no other virtualization components exist, it means that the virtualization component 310 is the first virtualization component added to the kernel 301. Accordingly, the management component 315 can register the global interrupt handling function 415 with the kernel 301.

[0048] As shown in Figure 4, the registered global interrupt handling function 415 can be bound to an interrupt for a virtual machine. In this way, when an interrupt for a virtual machine is triggered, the global interrupt handling function 415 can be called first. Through the global interrupt handling function 415, the interrupt handling function (also called the first interrupt handling function) corresponding to the virtualization component (also called the first virtualization component) that created the virtual machine can be determined. The interrupt handling function can be called to handle the interrupt. Exemplarily, if the virtual machine targeted by the triggered interrupt runs on the virtualization component 310-2, the interrupt handling function 410-2 can be called to handle the interrupt.

[0049] In some embodiments, if interrupt handling function set 401 is maintained, the interrupt handling function to be called can be determined by global interrupt handling function 415 in the following manner. For example, global interrupt handling function 415 can obtain interrupt handling function set 401. The virtualization component on which the virtual machine is running can be determined based on the resources currently used by the virtual machine. For example, the virtualization component to which the virtual CPU currently running belongs can be determined. The interrupt handling function corresponding to the virtualization component can then be determined from interrupt handling function set 401.

[0050] In some embodiments, a new virtualization component can be added to the kernel 301. If a new virtualization component (also referred to as a second virtualization component) that is different from a registered virtualization component is added to the kernel 301, an interrupt handling function corresponding to the new virtualization component (also referred to as a second interrupt handling function) can be added to the interrupt handling function set 401. For example, when an updated (e.g., upgraded) virtualization component is inserted into the kernel, the new interrupt handling function corresponding to the updated virtualization component is also stored in the interrupt handling function set 401.

[0051] In this embodiment, after the new virtualization component is added to the kernel, a new virtual machine can be created using the new virtualization component. The previous virtual machine can also be migrated to the new virtualization component to achieve hot upgrade. In addition, the interrupt handling function can also be hot upgraded during the hot upgrade of the virtualization component.

[0052] In some embodiments, the interrupt handling functions in the interrupt handling function set 401 can be removed along with the corresponding virtualization components. For example, if a virtualization component (also referred to as a third virtualization component) among the multiple virtualization components 310 that have been added is removed from the kernel 301, the interrupt handling function corresponding to the virtualization component can be removed from the interrupt handling function set 401. For example, if the virtualization component 310-1 is removed from the kernel 301, the corresponding interrupt handling function 410-1 can be removed from the interrupt handling function set 401. In this embodiment, the management of invalid interrupt handling functions can be effectively avoided.

[0053] In some embodiments, if a virtualization component is removed, a determination is made as to whether any remaining virtualization components managed by the management component 315 exist in the kernel 301. If no remaining virtualization components exist in the kernel 301, the registration of the global interrupt handling function 415 with the kernel 301 is canceled. In other words, if no virtualization components managed by the management component 315 exist in the kernel 301, the global interrupt handling function 415 does not need to be maintained to avoid redundant storage.

[0054] Describe an example scenario. First, when the virtualization component is inserted into the kernel, the virtualization component can interact with the management component to save its own interrupt handling function to the interrupt handling function list. At this time, if the virtualization component is the first virtualization component inserted, the management component can register the interrupt and bind the corresponding global interrupt handling function. If the virtualization component is not the first virtualization component inserted, only the corresponding interrupt handling function can be saved. Then, when the interrupt is triggered, the global interrupt handling function can find the corresponding interrupt handling function from the interrupt handling function list and call the interrupt handling function based on the virtualization component to which the virtual CPU currently running belongs to execute the actual interrupt handling process. When the virtualization component is removed from the kernel, its corresponding interrupt handling function can also be removed.

[0055] Example procedures, devices, and equipment

[0056] 5 shows a flowchart of a process 500 for managing virtual machines according to some embodiments of the present disclosure. The process 500 may be implemented at an electronic device or computing system including the kernel 301.

[0057] In block 510 , in response to an interrupt being triggered for a virtual machine, a global interrupt handling function corresponding to a management component is called. The management component is used to manage shared virtualization resources of multiple virtualization components.

[0058] In block 520, a first interrupt handling function corresponding to the first virtualization component is determined through the global interrupt handling function. The virtual machine is created by the first virtualization component.

[0059] At block 530 , a first interrupt handling function is called to handle the interrupt.

[0060] In some embodiments, determining a first interrupt handling function corresponding to a first virtualization component includes: obtaining an interrupt handling function set, which includes interrupt handling functions corresponding to multiple virtualization components that have been added to the kernel; and determining the first interrupt handling function from the interrupt handling function set.

[0061] In some embodiments, process 500 also includes: in response to the first virtualization component being added to the kernel, determining whether there are other virtualization components in the kernel managed by the management component; in response to determining that there are no other virtualization components in the kernel, registering a global interrupt handling function with the kernel; and adding the first interrupt handling function to the interrupt handling function set.

[0062] In some embodiments, process 500 further includes: in response to a second virtualization component different from the plurality of virtualization components being added to the kernel, adding a second interrupt handling function corresponding to the second virtualization component to the set of interrupt handling functions.

[0063] In some embodiments, process 500 further includes: in response to a third virtualization component among the plurality of virtualization components being removed from the kernel, removing a third interrupt handling function corresponding to the third virtualization component from the set of interrupt handling functions.

[0064] In some embodiments, process 500 further includes: in response to the third virtualization component being removed, determining whether there are any remaining virtualization components managed by the management component in the kernel; and in response to determining that there are no remaining virtualization components in the kernel, canceling the registration of the global interrupt handling function with the kernel.

[0065] In some embodiments, process 500 further includes: in response to a predetermined type of resource in the shared virtualization resources being used by the first virtualization component, disabling the used resources for virtualization components other than the first virtualization component.

[0066] In some embodiments, the management component and the plurality of virtualization components are generated based on a built-in virtualization component in the kernel.

[0067] In some embodiments, the management component and the plurality of virtualization components run on an advanced RISC-based computing system.

[0068] Figure 6 shows a schematic block diagram of an apparatus 600 for managing virtual machines according to certain embodiments of the present disclosure. Apparatus 600 may be implemented as or included in an electronic device or computing system (which may include kernel 301). Each module / component in apparatus 600 may be implemented by hardware, software, firmware, or any combination thereof.

[0069] As shown, apparatus 600 includes a first calling module 610 configured to, in response to a virtual machine interrupt being triggered, call a global interrupt handling function corresponding to a management component, the management component being used to manage shared virtualized resources of multiple virtualization components. Apparatus 600 also includes a processing function determination module 620 configured to determine, through the global interrupt handling function, a first interrupt handling function corresponding to a first virtualization component, the virtual machine being created by the first virtualization component. Apparatus 600 also includes a second calling module 630 configured to call the first interrupt handling function to handle the interrupt.

[0070] In some embodiments, the processing function determination module 620 is configured to: obtain an interrupt processing function set, which includes interrupt processing functions corresponding to multiple virtualization components added to the kernel; and determine a first interrupt processing function from the interrupt processing function set.

[0071] In some embodiments, the device 600 also includes: a first judgment module, configured to determine whether there are other virtualization components managed by the management component in the kernel in response to the first virtualization component being added to the kernel; a global registration module, configured to register the global interrupt handling function with the kernel in response to determining that there are no other virtualization components in the kernel; and a first function adding module, configured to add the first interrupt handling function in the interrupt handling function set.

[0072] In some embodiments, the apparatus 600 further includes: a second function adding module configured to add a second interrupt handling function corresponding to the second virtualization component to the interrupt handling function set in response to a second virtualization component different from the multiple virtualization components being added to the kernel.

[0073] In some embodiments, the apparatus 600 further includes a function removal module configured to remove a third interrupt handling function corresponding to the third virtualization component from the interrupt handling function set in response to a third virtualization component among the multiple virtualization components being removed from the kernel.

[0074] In some embodiments, the device 600 also includes: a second judgment module, configured to determine whether there are remaining virtualization components managed by the management component in the kernel in response to the third virtualization component being removed; and a cancellation module, configured to cancel the registration of the global interrupt handling function to the kernel in response to determining that there are no remaining virtualization components in the kernel.

[0075] In some embodiments, the apparatus 600 further includes a locking module configured to, in response to a predetermined type of resource in the shared virtualization resources being used by the first virtualization component, disable the used resources for virtualization components other than the first virtualization component.

[0076] In some embodiments, the management component and the plurality of virtualization components are generated based on a built-in virtualization component in the kernel.

[0077] In some embodiments, the management component and the plurality of virtualization components run on an advanced RISC-based computing system.

[0078] FIG7 shows a block diagram of an electronic device 700 in which one or more embodiments of the present disclosure may be implemented. It should be understood that the electronic device 700 shown in FIG7 is merely exemplary and should not be construed as limiting the functionality and scope of the embodiments described herein. The electronic device 700 shown in FIG7 can be used to implement at least a portion of an electronic device or computing system including the core 301.

[0079] As shown in FIG7 , electronic device 700 is a general-purpose electronic device. Components of electronic device 700 may include, but are not limited to, one or more processors or processing units 710, memory 720, storage device 730, one or more communication units 740, one or more input devices 750, and one or more output devices 760. Processing unit 710 may be a real or virtual processor and is capable of performing various processes according to programs stored in memory 720. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to enhance the parallel processing capabilities of electronic device 700.

[0080] The electronic device 700 typically includes a plurality of computer storage media. Such media can be any accessible media that can be obtained by the electronic device 700, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 720 can be a volatile memory (e.g., registers, cache, random access memory (RAM)), a non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 730 can be a removable or non-removable medium and can include a machine-readable medium, such as a flash drive, a disk, or any other medium that can be used to store information and / or data and can be accessed within the electronic device 700.

[0081] The electronic device 700 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG. 7 , a disk drive for reading from or writing to a removable, non-volatile disk (e.g., a “floppy disk”) and an optical drive for reading from or writing to a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to a bus (not shown) by one or more data media interfaces. The memory 720 may include a computer program product 725 having one or more program modules configured to perform various methods or actions of various embodiments of the present disclosure.

[0082] The communication unit 740 enables communication with other electronic devices via a communication medium. Additionally, the functions of the components of the electronic device 700 can be implemented as a single computing cluster or multiple computing machines that can communicate via a communication connection. Thus, the electronic device 700 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0083] Input device 750 may be one or more input devices, such as a mouse, keyboard, or trackball. Output device 760 may be one or more output devices, such as a display, a speaker, or a printer. Electronic device 700 may also communicate with one or more external devices (not shown) via communication unit 740 as needed, such as storage devices, display devices, or the like, with one or more devices that allow a user to interact with electronic device 700, or with any device that allows electronic device 700 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0084] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0085] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to the present disclosure. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0086] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, such that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0087] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0088] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple implementations of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a part for a module, program segment or instruction, and a part for a module, program segment or instruction comprises one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0089] While various implementations of the present disclosure have been described above, the foregoing description is intended to be illustrative, not exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is selected to best explain the principles of the implementations, their practical applications, or improvements to existing technologies, or to enable others skilled in the art to understand the various implementations disclosed herein.

Claims

1. A method for managing a virtual machine, comprising: In response to an interrupt for a virtual machine being triggered, calling a global interrupt processing function corresponding to a management component, wherein the management component is used to manage shared virtualization resources of multiple virtualization components; Determining, by means of the global interrupt processing function, a first interrupt processing function corresponding to a first virtualization component, wherein the virtual machine is created by the first virtualization component; as well as The first interrupt processing function is called to process the interrupt.

2. The method according to claim 1, wherein determining a first interrupt handling function corresponding to the first virtualization component comprises: Obtaining an interrupt processing function set, which includes interrupt processing functions corresponding to the multiple virtualization components added to the kernel respectively; as well as The first interrupt processing function is determined from the interrupt processing function set.

3. The method according to claim 2, further comprising: In response to the first virtualization component being added to the kernel, determining whether there are other virtualization components in the kernel that are managed by the management component; In response to determining that the other virtualization components do not exist in the kernel, registering the global interrupt handling function with the kernel; as well as In the interrupt processing function set, the first interrupt processing function is added.

4. The method according to claim 2, further comprising: In response to a second virtualization component different from the plurality of virtualization components being added to the kernel, a second interrupt handling function corresponding to the second virtualization component is added to the interrupt handling function set.

5. The method according to claim 2, further comprising: In response to a third virtualization component among the plurality of virtualization components being removed from the kernel, a third interrupt handling function corresponding to the third virtualization component is removed from the interrupt handling function set.

6. The method according to claim 5, further comprising: In response to the third virtualization component being removed, determining whether there are any remaining virtualization components managed by the management component in the kernel; as well as In response to determining that the remaining virtualization component does not exist in the kernel, the registration of the global interrupt handling function with the kernel is cancelled.

7. The method according to claim 1, further comprising: In response to a predetermined type of resource in the shared virtualization resources being used by the first virtualization component, the used resources are disabled for virtualization components other than the first virtualization component.

8. The method according to claim 1, wherein the management component and the plurality of virtualization components are generated based on a built-in virtualization component in a kernel.

9. The method of claim 1, wherein the management component and the plurality of virtualization components run on an advanced reduced instruction set architecture (RISA) based computing system.

10. A device for managing a virtual machine, comprising: A first calling module is configured to call a global interrupt processing function corresponding to a management component in response to an interrupt for a virtual machine being triggered, wherein the management component is used to manage shared virtualization resources of multiple virtualization components; a processing function determination module, configured to determine a first interrupt processing function corresponding to a first virtualization component through the global interrupt processing function, wherein the virtual machine is created by the first virtualization component; as well as The second calling module is configured to call the first interrupt processing function to process the interrupt.

11. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 9 when executed by the at least one processing unit.

12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Interrupt information processing method, virtual machine monitor and interrupt controller

    CN105335222A

  • Virtual machine hot upgrade method and device, equipment, and storage medium

    CN113535215A

  • Hot upgrade method and device for virtual machine management program and storage medium

    CN114416148A

  • Method and device for managing virtual machine, equipment and storage medium

    CN117591241A

  • Generating quantization tables for image compression

    EP4111417A1