Skip to contentSkip to conversation

Fix errornous negation for isstubdom, which breaks HVM pci-passthrough.

PATCH In review Sander Eikelenboom 3 participants 5 messages Dec 10, 2016 – Dec 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix errornous negation for isstubdom, which breaks HVM pci-passthrough.

Commit 20b75251d9721d9c050a973c02baac396c794ade introduced an errornous negation which gave the isstubdom bool the opposite semantics, causing the subsequent code to take the wrong code path.

---
 tools/libxl/libxl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_pci.c +1 -1
index 3b707f3..8395352 100644
@@ -1001,7 +1001,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     int irq, i, rc, hvm = 0;
     uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
     uint32_t domainid = domid;
-    bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid);
+    bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
 
     if (type == LIBXL_DOMAIN_TYPE_INVALID)
         return ERROR_FAIL;
Signature · 7 lines
2.1.4


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

Nice catch!
ACK from me, thought I don't know if it really counts ;)

--
Cedric

Quoted 19 lines · Sander Eikelenboom

Commit 20b75251d9721d9c050a973c02baac396c794ade introduced an errornous negation which gave the isstubdom bool the opposite semantics, causing the subsequent code to take the wrong code path.

---
 tools/libxl/libxl_pci.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_pci.c +1 -1
index 3b707f3..8395352 100644
@@ -1001,7 +1001,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
      int irq, i, rc, hvm = 0;
      uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
      uint32_t domainid = domid;
-    bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid);
+    bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
Quoted 3 lines


     if (type == LIBXL_DOMAIN_TYPE_INVALID)
         return ERROR_FAIL;

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

Acked-by on v1 1/1
#3 lore raw
In reply to Sander Eikelenboom
Quoted 5 lines · Sander Eikelenboom

Commit 20b75251d9721d9c050a973c02baac396c794ade introduced an errornous negation which gave the isstubdom bool the opposite semantics, causing the subsequent code to take the wrong code path.

Though I would like to shorten the title a bit. That is, I will move the clause "which ..." to the end of the commit log.

Commit 20b75251d9721d9c050a973c02baac396c794ade introduced an erroneous negation which gave the isstubdom bool the opposite semantics, causing the subsequent code to take the wrong code path, which breaks
...

Quoted 20 lines
---
 tools/libxl/libxl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_pci.c +1 -1
index 3b707f3..8395352 100644
@@ -1001,7 +1001,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     int irq, i, rc, hvm = 0;
     uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
     uint32_t domainid = domid;
-    bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid);
+    bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
 
     if (type == LIBXL_DOMAIN_TYPE_INVALID)
         return ERROR_FAIL;
Signature · 1 line
2.1.4

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

#4 lore raw
In reply to Wei Liu
Quoted 11 lines · Wei Liu
Quoted 5 lines · Sander Eikelenboom

Commit 20b75251d9721d9c050a973c02baac396c794ade introduced an errornous negation which gave the isstubdom bool the opposite semantics, causing the subsequent code to take the wrong code path.

Though I would like to shorten the title a bit. That is, I will move the clause "which ..." to the end of the commit log.

Sure, thanks for taking care !

--
Sander

Quoted 20 lines

Commit 20b75251d9721d9c050a973c02baac396c794ade introduced an erroneous negation which gave the isstubdom bool the opposite semantics, causing the subsequent code to take the wrong code path, which breaks
...

Quoted 15 lines
---
 tools/libxl/libxl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libxl/libxl_pci.c +1 -1
index 3b707f3..8395352 100644
@@ -1001,7 +1001,7 @@ static int do_pci_add(libxl__gc *gc, uint32_t domid, libxl_device_pci *pcidev, i
     int irq, i, rc, hvm = 0;
     uint32_t flag = XEN_DOMCTL_DEV_RDM_RELAXED;
     uint32_t domainid = domid;
-    bool isstubdom = !libxl_is_stubdom(ctx, domid, &domainid);
+    bool isstubdom = libxl_is_stubdom(ctx, domid, &domainid);
 
Quoted 5 lines
Quoted 5 lines
tools/libxl/libxl_pci.c +0 -0
     if (type == LIBXL_DOMAIN_TYPE_INVALID)
         return ERROR_FAIL;
Signature · 1 line
2.1.4

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