[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] reset PCI devices on force removal even when QEMU returns error



commit 8233ca53adf008da54c01d55d3309c4b0999ddb5
Author:     Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
AuthorDate: Fri Nov 28 16:53:09 2014 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Tue Jan 6 11:15:45 2015 +0000

    reset PCI devices on force removal even when QEMU returns error
    
    On do_pci_remove when QEMU returns error, we just bail out early without
    resetting the device. On domain shutdown we are racing with QEMU exiting
    and most often QEMU closes the QMP connection before executing the
    requested command.
    
    In these cases if force=1, it makes sense to go ahead with rest of the
    PCI device removal, that includes resetting the device and calling
    xc_deassign_device. Otherwise we risk not resetting the device properly
    on domain shutdown.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 9ae37fa..f3ae132 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1243,7 +1243,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
             rc = ERROR_INVAL;
             goto out_fail;
         }
-        if (rc) {
+        if (rc && !force) {
             rc = ERROR_FAIL;
             goto out_fail;
         }
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.