Display power management in distributed virtualized systems

A system and method for display power management in a virtualized environment are disclosed. In accordance with one embodiment, a hypervisor that is executed by a first computer system receives a notification that a host operating system of a second computer system has received a command to dim a video display of the second computer system, and forwards the notification to a guest operating system of a virtual machine hosted by the first computer system. The hypervisor receives from the guest operating system a first signal that indicates that the hypervisor is to notify the host operating system to refrain from executing the command. The hypervisor then transmits a second signal that notifies the host operating system to refrain from executing the command.

TECHNICAL FIELD

This disclosure relates to computer systems, and more particularly, to display power management in virtualized computer systems.

BACKGROUND

A virtual machine (VM) is a portion of software that, when executed on appropriate hardware, creates an environment allowing the virtualization of an actual physical computer system (e.g., a server, a mainframe computer, etc.). The actual physical computer system is typically referred to as a “host machine” or a “physical machine,” and the operating system of the host machine is typically referred to as the “host operating system.”

A virtual machine may function as a self-contained platform, executing its own “guest” operating system and software applications. Typically, software on the host machine known as a “hypervisor” (or a “virtual machine monitor”) manages the execution of one or more virtual machines, providing a variety of functions such as virtualizing and allocating resources, context switching among virtual machines, etc.

A virtual machine may comprise one or more “virtual processors,” each of which maps, possibly in a many-to-one fashion, to a central processing unit (CPU) of the host machine. Similarly, a virtual machine may comprise one or more “virtual devices,” each of which maps, typically in a one-to-one fashion, to a device of the host machine (e.g., a network interface device, a CD-ROM drive, etc.). The hypervisor manages these mappings in a transparent fashion, thereby enabling the guest operating system and applications executing on the virtual machine to interact with the virtual processors and virtual devices as though they were actual physical entities.

DETAILED DESCRIPTION

An application that executes on a physical machine can provide power requirements to an operating system (OS). For example, a video player application might disable dimming of the video display when the application is visible on the display, but not when the application is minimized. However, this technique may not work when the application executes within a virtual machine. In other words, in the example above, if the video player application executes within a virtual machine (VM), then the disabling will not take effect, and consequently the display will be dimmable, even when the video player application is visible. Similarly, dimming may not be handled correctly when an application executing within a virtual machine outputs text or graphics to a video display of another computer system (e.g., an output host machine).

Described herein is a system and methods for handling display dimming when an application executes within a virtual machine. In accordance with one embodiment of the present disclosure, a hypervisor of a first computer system receives a notification that the host operating system (OS) of the second computer system has received a command to dim a video display of the second computer system, and forwards the notification to the guest OS of a virtual machine hosted by the first computer system. In response, the guest OS transmits a first signal that indicates that the hypervisor is to notify the host OS to refrain from executing the command. The hypervisor then transmits, in response to the first signal, a second signal that causes the host OS of the second computer system to refrain from executing the command. In this way, the guest OS, which typically lacks a facility to communicate directly with the host OS of the second computer system, can notify the host OS of the second computer system to refrain from executing the dimming command.

In one embodiment, dimming of the video display is always disabled via the above method, while in another embodiment, dimming of the video display is disabled only when the second computer system is communicably coupled to the first computer system (e.g., the first and second computer systems can communicate via a network, via a machine-to-machine direct link, etc.), while in yet another embodiment, dimming of the video display is disabled only when the second computer system is communicably coupled to the first computer system and output from the VM is visible in the video display. For example, when the second computer system is communicably coupled to the first computer system, but an application executing within the VM is in a minimized window, or is in a window completely behind another window, then in the latter embodiment, dimming of the video display is not disabled.

Embodiments of the present disclosure are thus capable of overcoming the inability of applications executing within a virtual machine to perform power management for remote video displays. In addition, embodiments of the present disclosure are also applicable to attenuating output of other types of remote output devices, such as lowering the volume of an audio speaker. For example, embodiments of the present disclosure may disable lowering of the volume of the audio portion of a streaming movie in a video player application. As in the case of display dimming, some embodiments may disable lowering the volume only when the host and remote computer systems are communicably coupled, while some other embodiments may disable lowering the volume only when the application is currently outputting audio to the remote speaker, while still other embodiments may always disable lowering the volume, regardless of whether the host and remote computer systems are communicably coupled or whether the application outputs audio to the speaker.

FIG. 1depicts an illustrative architecture of the salient elements of a system100, in accordance with an embodiment of the present invention. One skilled in the art will appreciate that other architectures for system100are possible, and that the implementation of a computer system utilizing embodiments of the invention are not necessarily limited to the specific architecture depicted byFIG. 1.

As shown inFIG. 1, system100comprises a computer system110and an output host190, connected via a network150. Computer system110comprises a central processing unit (CPU)160, main memory170, which may include volatile memory devices (e.g., random access memory (RAM)), non-volatile memory devices (e.g., flash memory), and/or other types of memory devices, and storage device175(e.g., one or more hard disk drives, solid-state drives, etc.). It should be noted that although, for simplicity, a single CPU160is depicted inFIG. 1, in some other embodiments computer system110may comprise a plurality of CPUs160, rather than a single CPU. Similarly, in some other embodiments computer system110may comprise a plurality of memories170and/or a plurality of storage devices175.

The computer system110may be a server, a mainframe, a workstation, a personal computer (PC), a mobile phone, a palm-sized computing device, etc. The network150may be a private network (e.g., a local area network (LAN), a wide area network (WAN), intranet, etc.) or a public network (e.g., the Internet).

Computer system110runs a host operating system (OS)120, which manages the hardware resources of the computer system and that provides functions such as interprocess communication, scheduling, memory management, and so forth. In one embodiment, host operating system120also comprises a hypervisor125, which provides a virtual operating platform for virtual machine(s)130and that manages the execution of virtual machine(s)130. It should be noted that in some alternative embodiments, hypervisor125may be external to host OS120, rather than embedded within host OS120.

In one embodiment, hypervisor125includes an output manager128that is capable of disabling dimming of remote video displays, disabling attenuation of remote output devices, determining whether another computer system (e.g., output host190, etc.) is communicably coupled to computer system110(e.g., whether another computer system and computer system110can communicate via network150, etc.), and determining whether output from virtual machine130is visible on a video display of another computer system (e.g., video display194of output host190, etc.). Embodiments of operations of output manager128are described in more detail below with respect toFIGS. 3 through 7.

Virtual machine130is a software implementation of a machine that executes programs as though it were an actual physical machine. One embodiment of virtual machine130is described in more detail below with respect toFIG. 2.

Output host190comprises a central processing unit (CPU)191, main memory192, which may include volatile memory devices (e.g., random access memory (RAM)), non-volatile memory devices (e.g., flash memory), and/or other types of memory devices, a video display194(e.g., a liquid crystal display (LCD), a cathode ray tube (CRT) display, etc.), and one or more output devices195-1through195-N (e.g., an audio speaker, a printer, etc.), where N is a positive integer. It should be noted that although, for simplicity, a single video display194is depicted inFIG. 1, in some other embodiments output host190may comprise a plurality of video displays.

Output host190may be a server, a mainframe, a workstation, a personal computer (PC), a mobile phone, a palm-sized computing device, etc. Output host190runs an output host OS198that manages the hardware resources of output host190and provides functions such as interprocess communication, scheduling, memory management, and so forth.

FIG. 2depicts a block diagram of the salient elements of virtual machine130, in accordance with an embodiment of the present invention. As shown inFIG. 2, virtual machine130comprises a guest operating system220, a virtual processor260, a virtual video display294, and one or more virtual output devices295-1through295-M, where M is a positive integer.

Guest operating system (OS)220comprises software that manages the execution of programs within virtual machine130. In addition, guest OS220includes a virtual output manager225which is capable of performing the pertinent blocks ofFIGS. 4 through 7below, including transmitting signals that indicate that hypervisor125should notify output host OS198to refrain from executing display dimming commands.

Some embodiments of the functionality of virtual output manager225are described in detail below with respect toFIGS. 4 through 7.

Virtual processor260emulates a physical processor and maps to central processing unit (CPU)160. Similarly, virtual video display294emulates and maps to a physical video display (e.g., video display194of output host190, etc.), and each virtual output device295emulates and maps to a physical output device (e.g., an output device195of output host190, etc.). In one embodiment, the mapping between virtual output devices295and output devices195may be one-to-one (in which case M=N), while in some other embodiments, the number of virtual devices295may not be the same as the number of devices195(i.e., M≠N), and/or the mapping may not be one-to-one. In one embodiment, hypervisor125manages these mappings in a transparent fashion, so that guest OS220and applications executing on virtual machine130interact with virtual processor260, virtual video display294and virtual output devices295as though they were actual physical entities.

FIG. 3depicts a flow diagram of one embodiment of a first method300for display power management in a virtualized computer system. The method is performed by processing logic that may comprise hardware (circuitry, dedicated logic, etc.), software (such as is run on a general purpose computer system or a dedicated machine), or a combination of both. In one embodiment, the method is performed by the computer system110ofFIG. 1(e.g., by output manager128of hypervisor125and/or virtual output manager225of VM130), while in some other embodiments, some or all of the method might be performed by another machine.

At block301, a notification is received that indicates that output host OS198has received a command to dim a video display (e.g., video display194of output host190, etc.), or to attenuate output of an output device (e.g., an output device195-J of output host190, where J is an integer between 1 and N inclusive). In one embodiment, the notification is from an application that executes in virtual machine130and wishes to disable dimming of the video display (e.g., in response to a user manipulating a slider control for the brightness of the video display, etc.) or disable attenuation of the output device. In one embodiment, the notification is received by output manager128of hypervisor125.

At block302, the notification is handled. In one embodiment, the notification is handled by output manager128and virtual output manager225in accordance with the method ofFIG. 4, described below, while in another embodiment the notification is handled by output manager128and virtual output manager225in accordance with the method ofFIGS. 5A and 5B, described below. After block302, execution continues back at block301.

FIG. 4depicts a flow diagram of one embodiment of a method by which a first computer system (e.g., computer system110, etc.) handles a notification that a host operating system of a second computer system (e.g., output host190, etc.) has received a command to dim a video display (or attenuate an output device) of the second computer system. In this method, dimming of the display (or attenuation of the output device) is disabled regardless of whether the second computer system is communicably coupled to the first computer system (e.g., via a network, via a machine-to-machine direct link, etc.), and regardless of whether output from the virtual machine is visible in the video display of the second computer system. In some instances the handling of dimming and attenuation commands in the embodiment ofFIG. 4may be instead of that ofFIGS. 5A and 5B, described below, where dimming of the display (or attenuation of the output device) is disabled only when the first and second computer systems are communicably coupled (or optionally, only when the first and second computer systems are communicably coupled and output from the virtual machine is also visible). It should be noted that blocks depicted inFIG. 4can be performed simultaneously or in a different order than that depicted.

At block410, hypervisor125forwards the notification to guest OS220. In one embodiment, the notification is forwarded by output manager128and is received by virtual output manager225.

At block415, guest OS220receives the notification. At block425, guest OS220transmits a first signal that indicates that hypervisor125should notify output host OS198to refrain from executing the command received at block301ofFIG. 3, in order to prevent dimming of the video display (or attenuation of the output device) by the application within VM130that transmitted the notification at block301. In one embodiment, virtual output manager225transmits this signal to output manager128.

At block430, hypervisor125transmits, in response to the first signal, a second signal that causes output host OS198to refrain from executing the command, in order to prevent dimming of the video display (or attenuation of the output device) via the application. In one embodiment, block430is performed by output manager128. At block444, output host OS198ignores the command, thereby ensuring that dimming of the video display (or attenuation of the output device) via the application is in fact disabled.

FIGS. 5A and 5Bdepict a flow diagram of one embodiment by which a first computer system (e.g., computer system110, etc.) handles a notification that a host operating system of a second computer system (e.g., output host190, etc.) has received a command to dim a video display (or attenuate an output device) of the second computer system. In this method, dimming of the display (or attenuation of the output device) is disabled only when the first computer system and the second computer system are communicably coupled (or optionally, only when the first and second computer systems are communicably coupled and output from the virtual machine is also visible). It should be noted that blocks depicted inFIGS. 5A and 5Bcan be performed simultaneously or in a different order than that depicted.

At block510, hypervisor125forwards the notification to guest OS220. In one embodiment, the notification is forwarded by output manager128and is received by virtual output manager225.

At block515, guest OS220receives the notification. Block525branches based on whether the first computer system and second computer system are communicably coupled. In one embodiment, hypervisor125may determine that the computer systems are communicably coupled and set a flag that enables guest OS220to check this condition at block525, while in some other embodiments, this condition may be checked in some other manner.

If the first and second computer systems are not communicably coupled, then execution proceeds to block544, otherwise execution continues at optional block535(or when optional block535is not implemented, at block555ofFIG. 5B). In one embodiment, block525is performed by virtual output manager225.

At optional block535, execution branches based on whether output from the virtual machine is visible in the video display. If not, execution proceeds to block544, otherwise execution continues at block555ofFIG. 5B.

At block544, output host OS198executes the command received at block301ofFIG. 3, in normal fashion. After block544, execution terminates.

At block555(FIG. 5B), guest OS220transmits a first signal that indicates that hypervisor125should notify output host OS198to refrain from executing the command received at block301ofFIG. 3, in order to prevent dimming of the video display (or attenuation of the output device) by the application within VM130that transmitted the notification at block301. In one embodiment, virtual output manager225transmits this signal to output manager128.

At block560, hypervisor125transmits, in response to the first signal, a second signal that causes output host OS198to refrain from executing the command, in order to prevent dimming of the display (or attenuation of the output device) by the application. In one embodiment, block560is performed by output manager128. At block574, output host OS198ignores the command, thereby ensuring that dimming of the display (or attenuation of the output device) by the application is in fact disabled.

It should be noted that some embodiments may incorporate additional features into the method ofFIGS. 5A and 5B. For example, in some embodiments, when block544is executed, hypervisor125may also set a flag that indicates that the condition of block525(or, optionally, the condition of both block525and535) was not satisfied, and may continue monitoring the condition to determine when it is subsequently satisfied. In such embodiments, when the condition is determined to be subsequently satisfied and the flag is set, hypervisor125may then clear the flag and transmit a signal that causes output host OS198to refrain from executing future dimming commands.

FIG. 6depicts a flow diagram of one embodiment of a second method600for display power management in a virtualized computer system. The method is performed by processing logic that may comprise hardware (circuitry, dedicated logic, etc.), software (such as is run on a general purpose computer system or a dedicated machine), or a combination of both. In one embodiment, the method is performed by the computer system110ofFIG. 1(e.g., by output manager128of hypervisor125and/or virtual output manager225of VM130), while in some other embodiments, some or all of the method might be performed by another machine. It should be noted that blocks depicted inFIG. 6can be performed simultaneously or in a different order than that depicted.

At block601, hypervisor125receives a request from guest OS220to prohibit dimming of video display194of output host190(or to prohibit attenuation of an output device195J of output host190, where J is an integer between 1 and N inclusive). At block602, hypervisor125determines whether output from virtual machine130is visible in display194of output host190(or is being outputted by output device195J). Block603branches based on the determination of block602; if output is not visible in display194, then execution proceeds to block604, otherwise execution continues at block605.

At block604, hypervisor125refuses the request. After block604, execution of the method ofFIG. 6terminates.

At block605, hypervisor125forwards the request to output host190. At block606, hypervisor125determines that output from virtual machine130is no longer visible in display194of output host190(or is no longer being outputted by output device195J).

At block607, hypervisor125transmits a message to output host190indicating that dimming of video display194(or attenuation of output device195J) is permitted. At block608, hypervisor125determines that output from virtual machine130is once again visible in display194of output host190(or is once again being outputted by output device195J). At block609, hypervisor125transmits a message to output host190-indicating that dimming of video display194(or attenuation of output device195J) is prohibited.

FIG. 7depicts a flow diagram of one embodiment of a third method for display power management in a virtualized computer system. The method is performed by processing logic that may comprise hardware (circuitry, dedicated logic, etc.), software (such as is run on a general purpose computer system or a dedicated machine), or a combination of both. In one embodiment, the method is performed by the computer system110ofFIG. 1(e.g., by output manager128of hypervisor125and/or virtual output manager225of VM130), while in some other embodiments, some or all of the method might be performed by another machine. It should be noted that blocks depicted inFIG. 7can be performed simultaneously or in a different order than that depicted.

At block701, hypervisor125receives a request from guest OS220to prohibit dimming of video display194of output host190(or to prohibit attenuation of an output device195J of output host190, where J is an integer between 1 and N inclusive). At block702, hypervisor125determines whether output from virtual machine130is visible in display194of output host190(or is being outputted by output device195J). Block703branches based on the determination of block702; if output is not visible in display194, then execution proceeds to block704, otherwise execution continues at block705.

At block704, hypervisor125refuses the request. After block704, execution of the method ofFIG. 7terminates.

At block705, hypervisor125forwards the request to output host190. At block706, hypervisor125receives a request from guest OS220to permit dimming of video display194(or to prohibit attenuation of output device195J). At block707, hypervisor125determines whether output from virtual machine130is visible in display194(or is being outputted by output device195J). Block708branches based on the determination of block707; if output is visible in display194, then execution proceeds to block709, otherwise execution continues at block710.

At block709, hypervisor125refuses the request. After block709, execution of the method ofFIG. 7terminates. At block710, hypervisor125forwards the request to output host190.

The illustrative computer system800includes a processing system (processor)802, a main memory804(e.g., read-only memory (ROM), flash memory, dynamic random access memory (DRAM) such as synchronous DRAM (SDRAM)), a static memory806(e.g., flash memory, static random access memory (SRAM)), and a data storage device816, which communicate with each other via a bus808.

The computer system800may further include a network interface device822. The computer system800also may include a video display unit810(e.g., a liquid crystal display (LCD) or a cathode ray tube (CRT)), an alphanumeric input device812(e.g., a keyboard), a cursor control device814(e.g., a mouse), and a signal generation device820(e.g., a speaker).

The data storage device816may include a computer-readable medium824on which is stored one or more sets of instructions826(e.g., instructions corresponding to the method ofFIG. 3, etc.) embodying any one or more of the methodologies or functions described herein. Instructions826may also reside, completely or at least partially, within the main memory804and/or within the processor802during execution thereof by the computer system800, the main memory804and the processor802also constituting computer-readable media. Instructions826may further be transmitted or received over a network via the network interface device822.

The algorithms and displays presented herein are not inherently related to any particular computer or other computer system. Various general purpose systems may be used with programs in accordance with the teachings herein, or it may prove convenient to construct more specialized computer system to perform the required method steps. The required structure for a variety of these systems will appear as set forth in the description below. In addition, the present invention is not described with reference to any particular programming language. It will be appreciated that a variety of programming languages may be used to implement the teachings of the invention as described herein.