]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
xl: initialise rc before using it in vcpuset
authorWei Liu <wei.liu2@citrix.com>
Wed, 4 Nov 2015 11:32:57 +0000 (11:32 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 4 Nov 2015 11:37:33 +0000 (11:37 +0000)
In 5b725e56 (xl: improve return and exit codes of vcpu related
functions), the return value of libxl_cpu_bitmap_alloc was not stored in
rc anymore. Yet the subsequent fprintf still used that.

Reinstate the original implementation, that is, to store return value of
libxl_cpu_bitmap_alloc in rc before using rc.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/xl_cmdimpl.c

index 2756d2feb32a72fc1a3a4e3df7a7399727e29e26..9b6b42ca2f1d40768ecffeac9dacc59b82ca0bba 100644 (file)
@@ -5473,7 +5473,8 @@ static int vcpuset(uint32_t domid, const char* nr_vcpus, int check_host)
         if (rc)
             return 1;
     }
-    if (libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus)) {
+    rc = libxl_cpu_bitmap_alloc(ctx, &cpumap, max_vcpus);
+    if (rc) {
         fprintf(stderr, "libxl_cpu_bitmap_alloc failed, rc: %d\n", rc);
         return 1;
     }