xl: initialise rc before using it in vcpuset

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>
This commit is contained in:
Wei Liu authored and Ian Campbell committed 2015-11-04 11:37:33 +00:00
1 parent 700772bc13
commit 6919a7dde4
1 file changed
+2 -1
+2 -1
View 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;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.