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

[Xen-changelog] [xen stable-4.5] libxl: Fix if{} nesting in do_pci_remove



commit 7ca2558c048c7d5d2a6d401e58181a06a00f9eeb
Author:     Ian Jackson <iwj@xxxxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Fri Nov 14 14:41:38 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
CommitDate: Mon Jan 5 16:45:13 2015 +0000

    libxl: Fix if{} nesting in do_pci_remove
    
    do_pci_remove contained this:
    
        if (type == LIBXL_DOMAIN_TYPE_HVM) {
           [stuff]
        } else if (type != LIBXL_DOMAIN_TYPE_PV)
            abort();
        {
    
    This is bizarre, and not correct.  The effect is that HVM guests end
    up running both the proper code and that intended for PV guests.  This
    causes (amongst other things) trouble when PCI devices are
    hot-unplugged from HVM guests.
    
    This bug was introduced in abfb006f "tools/libxl: explicitly grant
    access to needed I/O-memory ranges".
    
    This is clear candidate for Xen 4.5, being a bugfix to an important
    feature.
    
    Reported-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
    Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
    Tested-by: Robert Hu <robert.hu@xxxxxxxxx>
    Rlease-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    CC: Sander Eikelenboom <linux@xxxxxxxxxxxxxx>
    CC: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_pci.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 316643c..9ae37fa 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1247,9 +1247,9 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
             rc = ERROR_FAIL;
             goto out_fail;
         }
-    } else if (type != LIBXL_DOMAIN_TYPE_PV)
-        abort();
-    {
+    } else {
+        assert(type == LIBXL_DOMAIN_TYPE_PV);
+
         char *sysfs_path = libxl__sprintf(gc, 
SYSFS_PCI_DEV"/"PCI_BDF"/resource", pcidev->domain,
                                          pcidev->bus, pcidev->dev, 
pcidev->func);
         FILE *f = fopen(sysfs_path, "r");
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.5

_______________________________________________
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®.