Updated: October 28, 2024 |
When a guest shuts down, in either a controlled or uncontrolled shutdown, the qvm process should try to quiesce any physical devices used by the guest. This ensures that the guest driver doesn't continue writing to physical memory, which can leave the hardware in an unexpected or even damaged state.
When a guest shuts down and hence, its device drivers go away, the host hardware can't be expected to stay in the same state because the devices may be operating asynchronously (e.g., doing DMA writes, generating interrupts). To protect the integrity of the hardware, the qvm process in which the guest runs can be designed to quiesce any such device (i.e., make it go dormant) when the guest terminates.
For information on creating a custom vdev, see the Virtual Device Developer's Guide. For information on defining the vdev's control function to register a callback that runs during process shutdown, see Handling a qvm termination.