Patent ID: 7454756

Claim:
A method for sharing a physical device amongst at least first and second virtual machines (“VMs”) in a processing system, the method comprising: configuring the processing system to enable the first VM to directly access the physical device and to utilize full functionality of the physical device; a predetermined time after configuring the processing system to enable the first VM to directly access the physical device and to utilize full functionality of the physical device, performing operations comprising: idling the physical device by causing the physical device to complete all pending operations for the first VM and temporarily preventing further interactions between the first VM and the physical device, saving device state pertaining to the first VM from registers in the physical device to a first memory region associated with the first VM, loading device state pertaining to the second VM from a second memory region associated with the second VM to the registers in the physical device, and restarting the physical device to enable the second VM to directly access the physical device and to utilize full functionality of the physical device; a predetermined time after restarting the physical device for the second VM, performing operations comprising: idling the physical device, saving device state pertaining to the second VM from registers in the physical device to the second memory region associated with the second VM, reloading the saved device state pertaining to the first VM from the first memory region to the registers in the physical device, and restarting the physical device to enable the first VM to directly access the physical device and to utilize full functionality of the physical device; suspending the first VM prior to loading the device state for the second VM; suspending the second VM prior to loading the device state for the first VM; and periodically repeating the operations of idling the physical device, saving device state for a current VM, reloading device state for a next VM, and restarting the physical device to enable the next VM to directly access the physical device and to utilize full functionality of the physical device, according to a round robin schedule for the first and second VMs, wherein the predetermined times correspond to a configurable rate for switching between VMs.