Software upgrade method and related device
By extending the virtio protocol and utilizing MSIX interrupts to manage the upgrade status of virtio devices, the problems of complexity and high error rate during virtio controller software upgrades are solved, enabling a simple and efficient business recovery and upgrade process.
Patent Information
- Application Number
- CN202210842825.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-18
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-07-18
AI Technical Summary
The existing virtio controller software upgrade method is not flexible enough, making the upgrade process complex and prone to errors, especially in the hot-swapping operation of virtio devices.
By extending the virtio protocol and adding two registers, dev_upgrade_state and drv_upgrade_state, and utilizing MSIX interrupts to notify the host device to suspend and resume virtio services during virtio controller software upgrades, hot-plugging operations are avoided. Upgrade events are reported via interrupts, and service suspension and resumption are performed by reading hardware status.
It simplifies the business deployment process after upgrading virtio devices, reduces operational steps, lowers the probability of errors, and improves the flexibility and efficiency of software upgrades.
Smart Images

Figure CN115167892B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication and Internet, in particular to a software upgrading method and related equipment. BACKGROUND
[0002] With the rise of cloud computing, many smart network interface card (SNIC) / data center structured dedicated processor (DPU) manufacturers provide virtio devices such as virtio-net, virtio-blk devices, etc. Due to the complexity of virtio spec, most SNIC / DPU manufacturers deploy virtio controller software through built-in micro controller unit (MCU) or micro processor unit (MPU) to negotiate with the virtio driver of the HOST server on the control plane, and provide virtio devices conforming to virtio spec for the HOST server. However, the current upgrading method is not flexible enough, and therefore, the problem of how to improve the upgrading flexibility of virtio controller software needs to be solved urgently. SUMMARY
[0003] The embodiments of the present application provide a software upgrading method and related equipment, which can improve the software upgrading flexibility.
[0004] In a first aspect, the embodiments of the present application provide a software upgrading method applied to a host device, wherein the host device is in communication connection with hardware, and the method comprises the following steps:
[0005] When the software starts upgrading, a first interrupt message is received, wherein the first interrupt message is an interrupt message of a paravirtualization device reported by the hardware to the host device in a first preset interrupt manner;
[0006] First data in a first upgrading state register of the paravirtualization device is read, wherein the first upgrading state register is used to store hardware identification upgrading state;
[0007] When the first data meets a first preset condition, a specified service of the paravirtualization device is suspended.
[0008] In a second aspect, the embodiments of the present application provide a software upgrading device applied to a host device, wherein the host device is in communication connection with hardware, and the device comprises a receiving unit, a reading unit and a suspending unit, wherein:
[0009] The receiving unit is configured to receive a first interrupt message when software starts upgrading, the first interrupt message being an interrupt message reported by the hardware to a semi-virtualization device of the host device in a first preset interrupt manner.
[0010] The reading unit is configured to read first data in a first upgrade state register of the semi-virtualization device, the first upgrade state register being configured to store a hardware identification upgrade state.
[0011] The suspending unit is configured to suspend a specified service of the semi-virtualization device when the first data satisfies a first preset condition.
[0012] In a third aspect, an embodiment of the present application provides a host device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first aspect of the present application.
[0013] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to perform some or all of the steps described in the first aspect of the present application.
[0014] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps described in the first aspect of the present application. The computer program product can be a software installation package.
[0015] By implementing the embodiments of the present application, the following beneficial effects are achieved:
[0016] It can be seen that the software upgrade method and related device described in the embodiments of the present application are applied to a host device, the host device is in communication connection with hardware, when software starts upgrading, a first interrupt message is received, the first interrupt message being an interrupt message reported by the hardware to a semi-virtualization device of the host device in a first preset interrupt manner, first data in a first upgrade state register of the semi-virtualization device is read, the first upgrade state register being configured to store a hardware identification upgrade state, when the first data satisfies a first preset condition, a specified service of the semi-virtualization device is suspended, in this way, when upgrading, an upgrade event is reported through interrupt, and then a service is suspended by reading an upgrade state of the hardware, this upgrade process avoids pcie hot plug, and thus service recovery is simple and efficient, and the software upgrade flexibility can be improved. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0018] Figure 1 is a flow diagram of a software upgrading method provided by an embodiment of the present application;
[0019] Figure 2 is a flow diagram of another software upgrading method provided by an embodiment of the present application;
[0020] Figure 3 is a flow diagram of another software upgrading method provided by an embodiment of the present application;
[0021] Figure 4 is a flow diagram of another software upgrading method provided by an embodiment of the present application;
[0022] Figure 5 is a structural diagram of a host device provided by an embodiment of the present application;
[0023] Figure 6 is a functional unit composition block diagram of a software upgrading device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the person skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of the present application.
[0025] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned accompanying drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.
[0026] Reference to“an embodiment” herein means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase“in one embodiment” in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily all referring to a common set of embodiments, although they can. It is explicitly contemplated that embodiments described in one embodiment can be incorporated in other embodiments.
[0027] In the embodiments of the present application, the data processor (DPU) can be a special processor constructed in a data center, which can support infrastructure layer resource virtualization by using a software defined technology route, and be used for supporting infrastructure layer services such as storage, security, and quality of service management.
[0028] In the embodiments of the present application, virtio is an abstraction layer above a device in a semi-virtualization hypervisor, and virtio-net driving refers to a network device virtualization mode. Virtio-pci refers to a peripheral component interconnect (PCI) of a semi-virtualization device, and virtio-net driving is a semi-virtualization network driving.
[0029] The embodiments of the present application are described in detail as follows.
[0030] In the related art, when the virtio controller software is upgraded, there is no way to provide services (such as bar space access of the virtio device, vring-queue offload of the virtio-blk, IO and MEM access, and the like) for the host device HOST. Therefore, the conventional upgrade method of the virtio controller software is as follows: at the beginning of the upgrade, the virtio controller software cancels the virtio device already issued to the HOST by means of pcie hot pullout; and after the upgrade is completed, the virtio device is reissued to the HOST by means of pcie hot insertion. In this upgrade method, the pcie device corresponding to the virtio device of the HOST, and the netdev corresponding to the virtio-net and the diskdev corresponding to the virtio-blk are all deleted. After the upgrade, the bus_id, dev_id, and func_id of the virtio device pcie, and the names of the netdev and the diskdev corresponding thereto may all change. In addition, if the virtio device has enabled SR-IOV, the user also needs to re-enable the SR-IOV after the upgrade. After the upgrade, the operation process of the business redeployment is complex, and it is easy to make mistakes.
[0031] In order to avoid the access of the host device HOST to the virtio device in the upgrade interval, resulting in an abnormality. At present, most SNIC / DPU manufacturers use the pcie hot plug method to hot pull out the virtio device at the beginning of the upgrade of the controller software, avoid the access of the HOST to the hardware, and then reinsert the virtio device after the upgrade to the new version.
[0032] In the related art, as shown in Figure 1 Figure 1 For virtio controller software upgrade, the host device HOST includes a semi-virtualization device (virtio device) and a downstream port hot plug driver (downstream pciehp driver), and can include the following steps:
[0033] 1. The downstream pciehp driver receives the MSI interrupt of the downstream bridge reported by the hardware (CPU);
[0034] 2. The virtio device is notified to be hot pulled out;
[0035] 3. Hardware (FPGA / ASIC) closes the transaction layer packet (TLP) reply;
[0036] 4. Stop the old virtio controller;
[0037] 5. Start a new virtio controller;
[0038] 6. Open the TLP reply;
[0039] 7. Report the MSI interrupt of the downstream bridge;
[0040] 8. Notify the virtio device hot plug device.
[0041] It can be seen that in the related art, after upgrading, the service deployment needs to re-match the corresponding pcie device, netdev and diskdev device, and needs to re-SR-IOV (if SR-IOV is enabled before). This technical solution has many operation processes and complex steps, and is prone to errors.
[0042] Based on the defects of the related art, please refer to Figure 2 , Figure 2 is a flowchart of another software upgrading method provided by the embodiments of the present application, applied to a host device, the host device being in communication connection with hardware, as shown in the figure, the software upgrading method comprises:
[0043] 201. When the software starts upgrading, a first interrupt message is received, the first interrupt message being an interrupt message of a paravirtual device reported by the hardware to the host device in a first preset interrupt manner.
[0044] In a specific implementation, the first preset interrupt manner can be pre-set or system default, for example, the first preset interrupt manner can be a config msix interrupt manner.
[0045] The hardware can include at least one of the following: SNIC, DPU, etc., without limitation, and the hardware can also include a field programmable gate array (FPGA) / application specific integrated circuit (ASIC) and a CPU, the CPU can include at least one of the following: MPU, MCU, NPU, etc., without limitation.
[0046] Specifically, when the software starts upgrading, a message signaled interrupt extended (MSIX) interrupt of the virtio device can be received.
[0047] 202、read first data in the first upgrade state register of the para-virtualization device, the first upgrade state register being used for storing hardware-identified upgrade state.
[0048] In a specific implementation, the first upgrade state register is used for storing hardware-identified upgrade state, and the first upgrade state register can be a dev_upgrade_state register, and the dev_upgrade_state is used for hardware-identified upgrade state.
[0049] Specifically, the first data in the first upgrade state register of the para-virtualization device can be read.
[0050] 203、when the first data meets a first preset condition, suspend a specified service of the para-virtualization device.
[0051] The specified service can be preset or system default, and the specified service can include at least one of the following: releasing a queue, closing a memory (memory) of a pcie, I / O access, and the like, which are not limited herein. The first data can include dev_upgrade_begin, and when the first data includes dev_upgrade_begin, the specified service of the para-virtualization device is suspended.
[0052] The first preset condition can be preset or system default, and specifically, when the first data meets the first preset condition, the specified service of the para-virtualization device can be suspended, otherwise, when the first data does not meet the first preset condition, the specified service of the para-virtualization device can not be suspended. For example, after the virtio driver of the HOST receives an interrupt, the dev_upgrade_state register of the virtio device can be read, the value is dev_upgrade_begin, and the virtio device is suspended (including releasing a queue, closing a memory (mem) of a pcie, and I / O access).
[0053] Optionally, the method further includes the following steps:
[0054] A1、write second data in the second upgrade state register, the second upgrade state register being used for storing para-virtualization driver-identified suspension and recovery service state;
[0055] A2、when the second data meets a second preset condition, notify the hardware that the suspension is completed.
[0056] In a specific implementation, the second upgrade state register can be a drv_upgrade_state register, which is used to identify the suspension and resumption of service state of the virtio driver. The second data can include drv_suspend_finsh, and when the second data includes drv_suspend_finsh, the hardware is notified of the completion of suspension.
[0057] In the second upgrade state register, the second data is written, the second upgrade state register is used to store the suspension and resumption of service state of the para-virtualization driver, when the second data meets the second preset condition, the hardware is notified of the completion of suspension, otherwise, no notification operation can be performed.
[0058] In a specific implementation, the virtio-driver notifies the hardware of the completion of suspension by writing the drv_upgrade_state register as drv_suspend_finsh.
[0059] Optionally, the method can further include the following steps:
[0060] After the suspension of all para-virtualization devices is completed, the hardware is instructed to close the TLP reply, and the hardware is instructed to reply to UR.
[0061] In a specific implementation, after the suspension of all para-virtualization devices is completed, the hardware can be instructed to close the TLP reply, and the hardware can be instructed to reply to UR, that is, after the suspension of all virtio devices is completed, the hardware is notified to close the TLP reply, and the hardware replies to unsupported requests (UR) (for example, downstream, virtio device configuration space access).
[0062] Optionally, the method can further include the following steps:
[0063] B1, stopping the first type of para-virtualization controller software;
[0064] B2, starting the second type of para-virtualization controller software.
[0065] In a specific implementation, the first type of para-virtualization controller software can be understood as old or old para-virtualization controller software, that is, the virtualization controller software after upgrading, and the second type of para-virtualization controller software can be new para-virtualization controller software, that is, the virtualization controller software after upgrading, that is, stopping the old virtio controller software and starting the new virtio controller software.
[0066] Optionally, the method further comprises the following steps:
[0067] C1, receiving a second interrupt message, the second interrupt message being an interrupt message of the semi-virtualization device reported to the host device by the hardware in a second preset interrupt mode;
[0068] C2, reading a hardware state upgrade end, and resuming the specified service of the semi-virtualization device;
[0069] C3, notifying the hardware of completion of the resuming.
[0070] In a specific implementation, the second preset interrupt mode can be pre-set or system default, for example, the second preset interrupt mode can be a config msix interrupt mode. The second preset interrupt mode can be the same as or different from the first preset interrupt mode. Specifically, the second interrupt message can be received, the second interrupt message being an interrupt message of the semi-virtualization device reported to the host device by the hardware in a second preset interrupt mode, then the hardware state upgrade end is read, the specified service of the semi-virtualization device is resumed, and the hardware can be notified of completion of the resuming.
[0071] In a specific implementation, the config msix interrupt of the virtio device is reported to the HOST, the virtio driver of the HOST receives the interrupt, reads the dev_upgrade_state register of the virtio device, judges that the value is dev_upgrade_finish, resumes the virtio device (including opening the mem / io access of the pcie, applying for a queue, etc.), and the virtio driver notifies the hardware of completion of the resuming by writing the drv_upgrade_state register as drv_resume_finish.
[0072] In the embodiment of the application, the virtio protocol is extended, the HOST is notified to suspend the device by the MSIX interrupt when the virtio controller software upgrade starts, the virtio device does not provide services to the outside, and after the upgrade to the new version, the HOST is notified to resume the service by the MSIX interrupt. This upgrade mode avoids hot plug of the virtio device, and the service deployment after the upgrade is simple to resume.
[0073] For example, in the embodiment of the present application, the virtio spec is extended to add two registers, dev_upgrade_state and drv_upgrade_state. The dev_upgrade_state is used to identify the upgrade state of the hardware, and the drv_upgrade_state is used to identify the suspend and resume service state of the virtio driver. The definitions of the two registers are as follows:
[0074]
[0075] In the specific implementation, as shown in FIG. 16, the method can include the following steps: Figure 3
[0076] 1. When the software starts to upgrade, the virtio device (such as a virtio driver) reports to the HOST through the config msix interrupt;
[0077] 2. Read the hardware state in the upgrade, suspend the virtio device, and no longer serve externally. Specifically, after the HOST virtio driver receives the interrupt, the dev_upgrade_state register of the virtio device is read, and the value is judged to be dev_upgrade_begin. The virtio device is suspended (including releasing the queue and closing the pcie mem / io access);
[0078] 3. The virtio driver notifies the hardware to complete the suspension by writing the drv_upgrade_state register as drv_suspend_finsh;
[0079] 4. After all virtio devices are suspended, the hardware is notified to close the TLP reply, and the UR (downstream, virtio device configuration space access) is replied by the hardware;
[0080] 5. Stop the old virtio controller software;
[0081] 6. Start the new virtio controller software;
[0082] 7. Open the TLP reply of the hardware;
[0083] 8. Report the MSIX interrupt of the virtio device to the HOST through the config msix interrupt of the virtio device;
[0084] 9. Read the end of the hardware state upgrade, repair virtio device, specifically: HOST virtio driver receives an interrupt, reads the dev_upgrade_state register of the virtio device, judges the value to be dev_upgrade_finish, and restores the virtio device (including opening the pcie mem / io access, applying the queue, etc.).
[0085] 10. The virtio driver notifies the hardware of the completion of restoration by writing the drv_upgrade_state register as drv_resume_finish.
[0086] In the embodiments of the present application, a scheme for optimizing virtio controller upgrade is proposed: modify the virito specification, report the upgrade event to the virtio driver of the HOST through the config msix interrupt of the virtio device, make the virtio driver suspend the virtio service in the upgrade interval, and restore the virtio service after the upgrade is completed. In this way, after the upgrade is completed, the user needs to operate less deployment and has less workload, and it is not easy to make mistakes.
[0087] In the embodiments of the present application, the virtio controller upgrade event of SNIC / DPU is reported through the MSIX interrupt, the virtio driver suspends the service in the upgrade interval, and after the upgrade is completed, the service is restored, thereby avoiding pcie hot plug.
[0088] That is, in the embodiments of the present application, the specification of virtio is modified and expanded, and the upgrade event is reported through the config msix interrupt of the virtio device in the upgrade interval; the virtio driver suspends and restores the service by reading the upgrade state of SNIC / DPU; this upgrade process avoids pcie hot plug, so that the pcie device, netdev, and diskdev of the host are not deleted; after the upgrade is completed, it is not necessary to find the corresponding pcie device, netdev, and diskdev again to enable sr-iov, and the service restoration is simple and efficient.
[0089] It can be seen that the software upgrading method described in the embodiment of the application is applied to a host device, the host device is in communication connection with hardware, when software starts to upgrade, a first interrupt message is received, the first interrupt message is an interrupt message of a semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner, first data in a first upgrade state register of the semi-virtualization device is read, the first upgrade state register is used to store a hardware identification upgrade state, when the first data meets a first preset condition, a specified service of the semi-virtualization device is suspended, in this way, when upgrading, an upgrade event is reported through interrupt, and then the upgrade state of the hardware is read to suspend the service, the upgrade process avoids pcie hot plug, and thus the service recovery is simple and efficient, and the software upgrading flexibility can be improved.
[0090] Consistent with the above Figure 2 embodiment, please refer to Figure 4 , Figure 4 is another flow diagram of a software upgrading method provided by the embodiment of the application, applied to a host device, the host device is in communication connection with hardware, as shown in the figure, the software upgrading method comprises the following steps:
[0091] 401、software starts to upgrade, a first interrupt message is received, the first interrupt message is an interrupt message of a semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner.
[0092] 402、read first data in a first upgrade state register of the semi-virtualization device, the first upgrade state register is used to store a hardware identification upgrade state.
[0093] 403、when the first data meets a first preset condition, a specified service of the semi-virtualization device is suspended.
[0094] 404、a second interrupt message is received, the second interrupt message is an interrupt message of the semi-virtualization device reported by the hardware to the host device in a second preset interrupt manner.
[0095] 405、read hardware state upgrade end, and restore the specified service of the semi-virtualization device.
[0096] 406、notify the hardware to complete the restoration.
[0097] Wherein, the specific description of the above steps 401-406 can refer to the corresponding steps of the software upgrading method shown in Figure 2 , which will not be described here in detail.
[0098] It can be seen that the software upgrading method described in the embodiment of the application is applied to a host device, the host device is in communication connection with hardware, when software starts to upgrade, a first interrupt message is received, the first interrupt message is an interrupt message of a semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner, first data in a first upgrade state register of the semi-virtualization device is read, the first upgrade state register is used to store a hardware identification upgrade state, when the first data meets a first preset condition, a specified service of the semi-virtualization device is suspended, a second interrupt message is received, the second interrupt message is an interrupt message of the semi-virtualization device reported by the hardware to the host device in a second preset interrupt manner, it is read that the hardware state upgrade ends, the specified service of the semi-virtualization device is restored, the hardware is informed of completion of the restoration, in this way, when upgrading, an upgrade event is reported through interrupt, and then service suspension and restoration are performed through reading of the upgrade state of the hardware, the upgrade process avoids pcie hot plug, and therefore service restoration is simple and efficient, and the software upgrading flexibility can be improved.
[0099] Consistent with the above embodiment, please refer to Figure 5 , Figure 5 is a structural schematic diagram of a host device provided in the embodiment of the application, as shown in the figure, the host device includes a processor, a memory, a communication interface, and one or more programs, the above one or more programs are stored in the above memory and are configured to be executed by the above processor, the host device is in communication connection with hardware, in the embodiment of the application, the above program includes instructions for performing the following steps:
[0100] When software starts to upgrade, a first interrupt message is received, the first interrupt message is an interrupt message of a semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner;
[0101] First data in a first upgrade state register of the semi-virtualization device is read, the first upgrade state register is used to store a hardware identification upgrade state;
[0102] When the first data meets a first preset condition, a specified service of the semi-virtualization device is suspended.
[0103] Optionally, the above program further includes instructions for performing the following steps:
[0104] Second data is written in a second upgrade state register, the second upgrade state register is used to store a semi-virtualization drive identification suspension and restoration service state;
[0105] When the second data meets a second preset condition, the hardware is informed of completion of suspension.
[0106] Optionally, the above program further includes instructions for performing the following steps:
[0107] after all the semi-virtualization devices are suspended, instructing the hardware to close the TLP reply, and the hardware to reply the UR.
[0108] Optionally, the above program further includes instructions for performing the following steps:
[0109] stopping the first type of semi-virtualization controller software;
[0110] starting the second type of semi-virtualization controller software.
[0111] Optionally, the above program further includes instructions for performing the following steps:
[0112] receiving a second interrupt message, the second interrupt message being an interrupt message of the semi-virtualization device reported by the hardware to the host device in a second preset interrupt manner;
[0113] after reading the end of the hardware state upgrade, resuming the designated service of the semi-virtualization device;
[0114] informing the hardware of the completion of the resumption.
[0115] It can be seen that, in the host device described in the embodiments of the present application, the host device is in communication connection with the hardware, when the software starts to upgrade, a first interrupt message is received, the first interrupt message being an interrupt message of the semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner, first data in a first upgrade state register of the semi-virtualization device is read, the first upgrade state register being used to store the upgrade state of the hardware, when the first data meets a first preset condition, the designated service of the semi-virtualization device is suspended, thus, during the upgrade, the upgrade event is reported through the interrupt, and the service suspension is performed through the reading of the upgrade state of the hardware, the upgrade process avoids the pcie hot plug, the service resumption is simple and efficient, and thus the software upgrade flexibility can be improved.
[0116] Figure 6 is a functional unit composition block diagram of a software upgrade device 600 involved in the embodiments of the present application. The software upgrade device 600 is applied to a host device, the host device is in communication connection with hardware, and the software upgrade device 600 includes a receiving unit 601, a reading unit 602, and a suspension unit 603, wherein,
[0117] the receiving unit 601 is used to, when the software starts to upgrade, receive a first interrupt message, the first interrupt message being an interrupt message of a semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner;
[0118] The reading unit 602 is configured to read first data in a first upgrade state register of the semi-virtualization device, and the first upgrade state register is used to store a hardware identification upgrade state.
[0119] The suspending unit 603 is configured to suspend a specified service of the semi-virtualization device when the first data meets a first preset condition.
[0120] Optionally, the apparatus 600 is further configured to:
[0121] write second data in a second upgrade state register, and the second upgrade state register is used to store a semi-virtualization driver identification suspension and recovery service state;
[0122] notify the hardware of completion of suspension when the second data meets a second preset condition.
[0123] Optionally, the apparatus 600 is further configured to:
[0124] indicate the hardware to close a TLP reply and the hardware to return to UR after suspension of all semi-virtualization devices is completed.
[0125] Optionally, the apparatus 600 is further configured to:
[0126] stop first-type semi-virtualization controller software;
[0127] start second-type semi-virtualization controller software.
[0128] Optionally, the apparatus 600 is further configured to:
[0129] receive a second interrupt message, and the second interrupt message is an interrupt message of the semi-virtualization device reported by the hardware to the host device in a second preset interrupt manner;
[0130] read a hardware state upgrade end, and recover the specified service of the semi-virtualization device;
[0131] notify the hardware of completion of recovery.
[0132] It can be seen that the software upgrading apparatus described in the embodiments of the present application is applied to a host device, the host device is in communication connection with hardware, when software starts to upgrade, a first interrupt message is received, the first interrupt message is an interrupt message of a semi-virtualization device reported by the hardware to the host device in a first preset interrupt manner, first data in a first upgrade state register of the semi-virtualization device is read, the first upgrade state register is used to store a hardware identification upgrade state, when the first data meets a first preset condition, a specified service of the semi-virtualization device is suspended, in this way, when upgrading, an upgrade event is reported through interrupt, and then the upgrade state of the hardware is read to suspend the service, this upgrade process avoids pcie hot plug, and thus the service recovery is simple and efficient, and the software upgrading flexibility can be improved.
[0133] It can be understood that the functions of the program modules of the software upgrading apparatus of the embodiments can be specifically implemented according to the methods in the method embodiments, and the specific implementation process can be referred to the related description of the method embodiments, which will not be described here.
[0134] The embodiments of the present application further provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program causes a computer to execute part or all of the steps of any method described in the method embodiments, and the computer includes a semi-virtualization device.
[0135] The embodiments of the present application further provide a computer program product, and the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method described in the method embodiments. The computer program product can be a software installation package, and the computer includes a semi-virtualization device.
[0136] It should be noted that, for each of the foregoing method embodiments, in order to simply describe, each is described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0137] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0138] In several embodiments provided in the present application, it should be understood that the disclosed apparatus can be implemented in other manners. For example, the division of the apparatus embodiments described above is merely illustrative, and the division of the units can be changed according to actual needs. For example, the units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0139] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0140] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0141] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable memory. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the technical solutions or all or part of the technical solutions can be embodied in the form of a software product, which is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the above-mentioned method of each embodiment of the present application. The aforementioned memory includes: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0142] Those of ordinary skill in the art can understand that all or part of the steps of the various methods in the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer readable memory, which can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0143] The above has introduced the embodiments of the present application in detail, and the principles and implementation manners of the present application are described by applying specific examples. The above embodiment description is only used for helping understanding the method of the present application and its core idea; meanwhile, for the general technical personnel in the art, according to the idea of the present application, the specific implementation manner and application range will have changes, and the above is not understood as the limitation of the present application.
Claims
1. A software upgrade method characterized by comprising: The method is applied to a host device in communication connection with hardware, and comprises the following steps: When software starts upgrading, a first interrupt message is received, the first interrupt message being an interrupt message of a paravirtualization device reported by the hardware to the host device in a first preset interrupt mode, the first preset interrupt mode comprising a config msix interrupt mode; the first preset interrupt mode is modified virtio specification, and an upgrade event is reported through a config msix interrupt of the paravirtualization device; First data in a first upgrade status register of the paravirtualization device is read, the first upgrade status register being used for storing a hardware identification upgrade status; When the first data meets a first preset condition, a specified service of the paravirtualization device is suspended; the specified service comprises at least one of the following: releasing a queue, closing a memory of a pcie, and I / O access; the first data is used for indicating whether the specified service is suspended; when the first data comprises dev_upgrade_begin, it is determined that the first data meets the first preset condition; After suspension of all paravirtualization devices ends, the hardware is instructed to close a TLP reply, and the hardware is instructed to reply to a UR; First-type paravirtualization controller software is stopped; Second-type paravirtualization controller software is started; A second interrupt message is received, the second interrupt message being an interrupt message of the paravirtualization device reported by the hardware to the host device in a second preset interrupt mode; After hardware status upgrade ends, the specified service of the paravirtualization device is restored; The hardware is instructed to complete restoration.
2. The method of claim 1, wherein, The method further comprises the following steps: Second data is written in a second upgrade status register, the second upgrade status register being used for storing a paravirtualization driver identification suspension and restoration service state; When the second data meets a second preset condition, the hardware is instructed to complete suspension; the second data is used for indicating whether hardware suspension is completed; when the second data comprises drv_resume_finish, it is determined that the second data meets the second preset condition.
3. A software upgrade apparatus, characterized by comprising: The device is applied to a host device in communication connection with hardware, and comprises a receiving unit, a reading unit, and a suspension unit, wherein, The receiving unit is configured to, when software starts upgrading, receive a first interrupt message, the first interrupt message being an interrupt message of a paravirtualization device reported by the hardware to the host device in a first preset interrupt mode, the first preset interrupt mode comprising a config msix interrupt mode; the first preset interrupt mode is modified virtio specification, and an upgrade event is reported through a config msix interrupt of the paravirtualization device; The reading unit is configured to read first data in a first upgrade status register of the paravirtualization device, the first upgrade status register being used for storing a hardware identification upgrade status; The suspension unit is configured to, when the first data meets a first preset condition, suspend a specified service of the paravirtualization device; the specified service comprises at least one of the following: releasing a queue, closing a memory of a pcie, and I / O access; the first data is used for indicating whether the specified service is suspended; when the first data comprises dev_upgrade_begin, it is determined that the first data meets the first preset condition. The suspension unit is configured to suspend a specified service of the semi-virtualization device when the first data meets a first preset condition; the specified service includes at least one of the following: releasing a queue, closing a memory of a pcie, and I / O access; the first data is used to indicate whether to suspend the specified service; when the first data includes dev_upgrade_begin, it is determined that the first data meets the first preset condition. The apparatus is further configured to: After suspension of all semi-virtualization devices ends, instruct the hardware to close a TLP reply, and the hardware to reply to a UR; Stop first-type semi-virtualization controller software; Start second-type semi-virtualization controller software; Receive a second interrupt message, which is an interrupt message of the semi-virtualization device reported by the hardware to the host device in a second preset interrupt manner; Read a hardware state upgrade end, and restore the specified service of the semi-virtualization device; Notify the hardware of completion of restoration.
4. The apparatus of claim 3, wherein, The apparatus is further configured to: Write second data into a second upgrade state register, which is used to store a semi-virtualization drive identification suspension and a recovery service state; When the second data meets a second preset condition, notify the hardware of completion of suspension; the second data is used to indicate whether the hardware suspension is completed; when the second data includes drv_resume_finish, it is determined that the second data meets the second preset condition.
5. A host device, comprising: A computer program product for electronic data interchange, wherein the computer program product causes a computer to perform the method of claim 1 or 2.
6. A computer-readable storage medium, characterized in that, A computer program product for electronic data interchange, wherein the computer program product causes a computer to perform the method of claim 1 or 2.
Citation Information
Patent Citations
Virtual-machine hot-upgrading method and virtual-machine hot-upgrading apparatus
CN107844304A