Skip to contentSkip to conversation

libxl/libxl_pci.c: Fix reverse logic when detaching device

PATCH In review Chao Gao 2 participants 2 messages Feb 23, 2017 – Feb 24, 2017

lore
Share & tools
lore

Chao Gao

author
#0 lore raw

PATCH 1/1 libxl/libxl_pci.c: Fix reverse logic when detaching device

Commit 20b75251d97 ("libxl/libxl_pci.c: used LOG*D functions") reverses the logic to call xc_deassign_device(). It makes the device unusable.

---
 tools/libxl/libxl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_pci.c +1 -1
index 8395352..b14df16 100644
@@ -1370,7 +1370,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
     int hvm = 0, rc, num;
     int stubdomid = 0;
     uint32_t domainid = domid;
-    bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid);
+    bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
 
 
     assigned = libxl_device_pci_list(ctx, domid, &num);
Signature · 7 lines
1.8.3.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 4 lines · Chao Gao

Commit 20b75251d97 ("libxl/libxl_pci.c: used LOG*D functions") reverses the logic to call xc_deassign_device(). It makes the device unusable.

Acked + applied.

Quoted 20 lines
---
 tools/libxl/libxl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_pci.c +1 -1
index 8395352..b14df16 100644
@@ -1370,7 +1370,7 @@ static int do_pci_remove(libxl__gc *gc, uint32_t domid,
     int hvm = 0, rc, num;
     int stubdomid = 0;
     uint32_t domainid = domid;
-    bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid);
+    bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
 
 
     assigned = libxl_device_pci_list(ctx, domid, &num);
Signature · 1 line
1.8.3.1

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel