Patent ID: 7853960

Claim:
In a computer system that includes at least one virtual machine that runs as a guest on a host hardware platform, that has a guest operating system and at least one virtual processor, and that submits I/O requests to at least one virtual device that corresponds to a physical device, a method for virtualizing I/O completions by the virtual device comprising: backing the virtual device with a backing device; determining timing constraints of the physical device, including a nominal I/O completion delay time; defining timing parameters for scheduling deliveries of completion interrupts during emulation of the physical device including at least partially basing the timing parameters on the timing constraints of the physical device; detecting an actual I/O completion interrupt from the backing device; detecting a safepoint, that is, a point of execution of the virtual processor that indicates that the virtual processor is in a condition to receive the actual I/O completion interrupt; if the detected safepoint occurs before the nominal I/O completion delay time, dispatching the actual I/O completion interrupt upon occurrence of the safepoint, before the nominal I/O completion delay time, thereby enabling device emulation acceleration relative to limiting deliveries of said completion interrupts to a schedule that is based on said timing parameters alone; dedicating a local delay queue to the virtual processor, the local delay queue holding time-stamped indications of completed I/O requests by the backing device; determining that the virtual processors has reached an interrupt safepoint before a particular completion interrupt is dispatched from a global delay queue, said global delay queue including time-stamped indications from multiple local delay queues; and re-spacing the local delay queue from which said particular completion interrupt is dispatched with respect to time.