摘要 |
<p>A method for upgrading a Hypervisor component and a computer system are disclosed. The method for upgrading a Hypervisor component includes: calling, by a kernel of a virtual machine, a hypercall interface of a Hypervisor, and loading an upgrade file to an address space of the Hypervisor, where the upgrade file is used for upgrading a target function in a Hypervisor component; calling, by the kernel of the virtual machine, the hypercall interface of the Hypervisor, and replacing an instruction at a starting position of the target function in the Hypervisor component that needs to be upgraded with a first interrupt instruction; and if it is judged by an interrupt processing program included in the kernel of the virtual machine that a breakpoint exception is caused by the first interrupt instruction, calling, by the kernel of the virtual machine, the hypercall interface of the Hypervisor, and replacing the first interrupt instruction with a jump instruction that is required for the upgrade, so as to upgrade the target function in the Hypervisor component that needs to be upgraded to the upgrade function. With the technical solutions in the embodiments of the present invention, a device resource that upgrading the Hypervisor component needs to occupy can be reduced, and an impact caused by the upgrade on a service can be mitigated.</p> |