commit 7fb699eced1e58b25203d7f6bae9ef44318d8e6b Author: Konrad Rzeszutek Wilk Date: Tue Apr 22 09:58:28 2014 -0400 libxl: give pciback a chance to do its teardown before we reset the device. We try to reset the device before we signal the pciback that the device is no longer to be used by the guest. As such we should give the pciback (or QEMU) a chance first to some cleanup before we deploy the sledghammer approach of resetting the device. Signed-off-by: Konrad Rzeszutek Wilk diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c index 44d0453..5a7cc9e 100644 --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -1260,6 +1260,8 @@ skip1: abort(); } out: + libxl__device_pci_remove_xenstore(gc, domid, pcidev); + /* don't do multiple resets while some functions are still passed through */ if ( (pcidev->vdevfn & 0x7) == 0 ) { libxl__device_pci_reset(gc, pcidev->domain, pcidev->bus, pcidev->dev, pcidev->func); @@ -1277,8 +1279,6 @@ out: libxl__device_pci_remove_common(gc, stubdomid, &pcidev_s, force); } - libxl__device_pci_remove_xenstore(gc, domid, pcidev); - rc = 0; out_fail: free(assigned);