The present application claims the benefit under 35 U.S.C. §119 of German Patent Application No. DE 102015214389.9 filed on Jul. 29, 2015, which is expressly incorporated herein by reference in its entirety.
The present invention relates to a method for updating a virtual machine operated under a hypervisor on a physical machine having a random-access memory and a read-only memory. The present invention also relates to a corresponding device, a corresponding computer program as well as a corresponding storage medium.
Generally, conventional vehicle control units have capabilities for on-board diagnostics. Typically, the diagnosis supplied in this context relates to the control unit itself, its functionality and software update. These capabilities of generic control units may be accessed, for instance, with the aid of many different vehicle communication networks such as CAN, Flexray or ethernet and specific diagnostic protocols such as OBD. To produce a diagnostic communications link between the control unit and an external diagnostic tool, such a control unit has a diagnostic address. In the case of a single software system within the control unit, the capabilities described can be considered state-of-the-art.
In a virtualized control unit, however, there are several software systems, what are referred to as guest systems, and the additional software components of a hypervisor. As a result, diagnostic capabilities are needed with regard to status information for each guest system, the hardware and the hypervisor. Finally, the guest systems and the hypervisor must be updated.
German Patent No. DE 19921845 A1 describes a diagnostic-test device for motor vehicles, programmable control units in the motor vehicle being provided with self-diagnostic means which, under program control, control and monitor the engine management and other systems of the motor vehicle, generate and store error codes, and which are connectable via a diagnostic/test connector on the motor-vehicle side to an external diagnostic tester. The external diagnostic tester is equipped with a program-recognition and program-loading device. With the aid of the program-recognition device, the program version contained in the connected control unit is queried and recognized. If the program present on the motor-vehicle side in the connected control unit of the vehicle and recognized via the diagnostic/test connector is not stored in the newest and most current version, the latest version in each case is then loaded by the program-loading device of the diagnostic tester into the program memory of the corresponding control unit.
The present invention provides a method for updating a virtual machine operated under a hypervisor on a physical machine having a random-access memory and a read-only memory, a corresponding device, a corresponding computer program as well as a corresponding storage medium.
The design according to the present invention is based on the recognition that a virtualized system has more updatable components than a single software system. Here, there are several guest systems and the hypervisor itself, which require updating independently of each other.
An advantage of the approach according to the present invention lies in the retention of existing procedures based on diagnostic communication and diagnostic address as well as boot manager. Thus, each guest system retains its own diagnostic address, and is capable of processing diagnostic communication. The communication infrastructure may either be divided among a plurality of guest systems or reserved exclusively for one guest system.
In this context, the capability of certain embodiments of the invention to update a productive environment in operation is especially advantageous. This means that hypervisors and virtual machines together with the application programs executed by them may continue to be operated normally while a virtual machine or the hypervisor in said place is/are being updated.
The approach presented takes into account the circumstance that most control units—in automotive engineering, for instance, one may think of engine management and body control or electronic stability program—execute their machine code directly from an internal flash memory. During the flash reprogramming carried out within the course of the updating in the case of such units, by using the method described here, application code may be executed during the reprogramming. This proves to be useful in as much as a simultaneous code execution is virtually impossible using a conventional approach.
The guest system may be operated at an increased authorization level and receive the updating request in place of the hypervisor, which ultimately is updated by the boot manager or a bootloader started by it. For purposes of updating, the hypervisor is thus, as it were, assigned to a guest system. In this way, it may be updated together with this particular guest system.
According to one variant, the guest system itself may determine a possible update and initiate it. A corresponding specific embodiment proves to be largely independent of any diagnostic tool.
Exemplary embodiments of the present invention are explained in greater detail below and illustrated in the figures.
While a conventional control unit 52 on its hardware platform 42 executes only one software 44 with a single diagnostic address A, in the case of virtualized control unit 40, a hypervisor 16 (virtual machine monitor, VMM) operates a first virtual machine 18 under diagnostic address B and a second virtual machine 32 under diagnostic address C on one joint physical machine 38. Both first virtual machine 18 and second virtual machine 32 are therefore capable of conducting diagnostic communication. Diagnostic address B or diagnostic address C represents both virtual machine 18, 32 operated under it as well as hypervisor 16 itself.
A diagnostic updating request 24 is received under diagnostic address B from an external unit 50, e.g., a diagnostic tester. First virtual machine 18 in question communicates this to hypervisor 16.
Addressed first virtual machine 18 requests of hypervisor 16 the transfer and execution of machine code 20 of hypervisor 16 and first virtual machine 18 from random-access memory (RAM) 12. If the configuration of hypervisor 16 allows it, hypervisor 16 transfers relevant machine code 20 into random-access memory 12, and continues 26 the execution from there. In this context, as a rule, first virtual machine 18 and second virtual machine 32 are only able to be updated within area boundaries 36 of their allocated resources such as storage space, devices and number of processor cores.
If area boundaries 36 are meant to be adapted, hypervisor 16 is therefore to be updated first.
First virtual machine 18 now restarts and executes a boot manager 28 (bootstrap loader, boot loader) from random-access memory 12. Boot manager 28 is reachable under diagnostic address B of first virtual machine 18.
Boot manager 28 thereupon receives further instructions and current machine code 22 in order to carry out the update by way of a diagnostic communication to diagnostic address B of first virtual machine 18 in question. Boot manager 28 selectively updates first virtual machine 18 or hypervisor 16 as a function of updating request 24.
Finally, boot manager 28 restarts first virtual machine 18 (26). The customary boot sequence now continues and restarts first virtual machine 18 (30). If hypervisor 16 was updated, first virtual machine 18 requests a complete system restart from hypervisor 16. In any case, new functionality first becomes active after either the restart of hypervisor 16 or of the system.
Number | Date | Country | Kind |
---|---|---|---|
102015214389.9 | Jul 2015 | DE | national |