]> xenbits.xensource.com Git - xenclient/toolstack.git/commitdiff
use the device.PCI.reset function in domain.destroy
authorVincent Hanquez <vincent.hanquez@eu.citrix.com>
Thu, 9 Apr 2009 12:13:45 +0000 (13:13 +0100)
committerVincent Hanquez <vincent.hanquez@eu.citrix.com>
Thu, 9 Apr 2009 12:13:45 +0000 (13:13 +0100)
xenops/domain.ml

index 981a5ac339e9d5020ca4b03f05dc38193ad183d2..df71b0084d4f69be99ebd8cf687caf8290780b11 100644 (file)
@@ -262,6 +262,10 @@ let destroy ?(preserve_xs_vm=false) ~xc ~xs domid =
        debug "Domain.destroy: all known devices = [ %a ]" (fun () -> String.concat "; ")
           (List.map string_of_device all_devices);
 
+       (* reset PCI devices before xc.domain_destroy otherwise we lot all IOMMU mapping *)
+       let all_pci_devices = List.filter (fun device -> device.backend.kind = Pci) all_devices in
+       List.iter (fun pcidev -> Device.PCI.reset ~xs pcidev) all_pci_devices;
+
        (* Now we should kill the domain itself *)
        debug "Domain.destroy calling Xc.domain_destroy (domid %d)" domid;
        log_exn_continue "Xc.domain_destroy" (Xc.domain_destroy xc) domid;