Patent ID: 9658873
Date: 2017-05-23
CPC Classifications: G06F

Claim:
1. A system for switching between an assigned device and an emulated device, the system comprising: one or more processors; a device-specific driver included in a hypervisor running on a host; a pass-through device driver included in the hypervisor, wherein a common host backend is coupled to the host and is bound to at most one of the device-specific driver and pass-through device driver at a time, wherein when the common host backend is bound to the pass-through device driver, a first guest running on a first virtual machine uses an assigned device that is assigned to the first virtual machine, and when the common host backend is bound to the device-specific driver, the first guest and a second guest running on a second virtual machine uses an emulated device, wherein the first and second virtual machines are running on the host, and the assigned and emulated devices access the common host backend; and a switch module that sends, by one or more processors, one or more communications to the first guest to cause the first quest to switch from using at most one of the assigned device or the emulated device to the other of the at most one of the assigned device or the emulated device, wherein if the common host backend is bound to the pass-through driver, the one or more communications indicates that the assigned device is to be removed and causes the first guest to stop using the assigned device, wherein in response to detecting that the first guest has stopped using the assigned device, the switch module removes the first guest's access to the assigned device, unbinds the common host backend from the pass-through device driver, and binds the common host backend to the device-specific driver, wherein after the common host backend is bound to the device-specific driver, the first and second guests access the emulated device, and wherein if the common host backend is bound to the device-specific driver, the one or more communications indicates that the emulated device is to be removed and causes the first guest to stop using the emulated device, wherein in response to detecting that the first guest has stopped using the emulated device, the switch module removes the first guest's access to the emulated device, unbinds the common host backend from the device-specific device driver, and binds the common host backend to the pass-through driver, wherein after the common host backend is bound to the pass-through driver, the second guest does not have access to the assigned device.