From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: [PATCH v1 1/2] libxl: give pciback a chance to do its teardown before we reset the device. Date: Wed, 4 Jun 2014 09:33:32 -0400 Message-ID: <1401888813-30987-2-git-send-email-konrad.wilk@oracle.com> References: <1401888813-30987-1-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WsBK7-0001xW-Ej for xen-devel@lists.xenproject.org; Wed, 04 Jun 2014 13:33:47 +0000 In-Reply-To: <1401888813-30987-1-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, ian.campbell@citrix.com Cc: Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org 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 --- tools/libxl/libxl_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 1.9.3