Skip to contentSkip to conversation

libxl: check return value of libxl_vcpu_setaffinity

PATCH In review Wei Liu 4 participants 4 messages Apr 8, 2015 – Apr 15, 2015

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 libxl: check return value of libxl_vcpu_setaffinity

That function can fail.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
Cc Dario Faggioli <[email protected]>

---
v2: add missing `}'.

---
 tools/libxl/libxl_dom.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
tools/libxl/libxl_dom.c +7 -2
index a88db69..8021ca6 100644
@@ -468,8 +468,13 @@ static int set_vnuma_affinity(libxl__gc *gc, uint32_t domid,
             goto out;
         }
 
-        libxl_for_each_set_bit(j, v->vcpus)
-            libxl_set_vcpuaffinity(CTX, domid, j, NULL, &cpumap);
+        libxl_for_each_set_bit(j, v->vcpus) {
+            rc = libxl_set_vcpuaffinity(CTX, domid, j, NULL, &cpumap);
+            if (rc) {
+                LOG(ERROR, "Can't set cpu affinity for %d", j);
+                goto out;
+            }
+        }
     }
 
 out:
Signature · 1 line
1.9.1