主权项 |
1. A system for sharing a device assigned to a plurality of virtual machines, the system comprising:
a plurality of virtual machines; an identification module that identifies a first virtual machine in which a device is active, wherein the device is active in only one of the plurality of virtual machines at a time, and wherein the first virtual machine controls the device; and a transfer module that communicates with the plurality of virtual machines and that, when a condition is satisfied, transfers control of the device from the first virtual machine to a second virtual machine, wherein the second virtual machine is in the plurality of virtual machines, and the transfer module comprises:
a control module that sends a first communication to the first virtual machine to cause (i) the first virtual machine to relinquish control of the device based on an indication that power will be removed from the device, and (ii) the first virtual machine to save first state information maintained by the first virtual machine to a first memory, wherein the first state information is associated with the device; anda state module that saves second state information maintained by a host machine to a second memory, wherein the second state information is associated with the first virtual machine and device. |