Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
As `addCleanup` handlers are called in reverse order, the resource cleanup happened in the wrong order: It first shut down network, then pools, then machines. This often led to "busy" errors if e. g. a domain was using an NFS pool that we tried to remove. To avoid the confusion, bundle all these calls in a single `stop_all()` helper which we can write in "natural order". Also avoid the `for` loop, which just made things unnecessarily complicated and caused qemu:///system resources to get cleaned up twice. We need to be a little creative with cleaning up running domains. TestMachinesVirtualization.testLibvirt sometimes leaves its VM in a shutting down state, so that it goes away during the iteration. Intercept and accept a "no such domain" error on destroy. This fixes `TestMachinesDisks.testAddDiskNFS`, whose failure was previously hidden due to `|| true`.
- Loading branch information