From: Vincent Hanquez Date: Thu, 9 Apr 2009 12:13:45 +0000 (+0100) Subject: use the device.PCI.reset function in domain.destroy X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1cb6a63315496a14ffbf9ba7d6efb9648cb6082c;p=xenclient%2Ftoolstack.git use the device.PCI.reset function in domain.destroy --- diff --git a/xenops/domain.ml b/xenops/domain.ml index 981a5ac..df71b00 100644 --- a/xenops/domain.ml +++ b/xenops/domain.ml @@ -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;