From: Wei Liu Subject: [PATCH v2] xl: initialise rc before using it in vcpuset Date: Wed, 4 Nov 2015 11:32:57 +0000 Message-ID: <1446636777-31896-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZtwJC-0004Wm-Oc for xen-devel@lists.xenproject.org; Wed, 04 Nov 2015 11:32:54 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Wei Liu , Ian Campbell , Andrew Cooper , Dario Faggioli , Ian Jackson , Harmandeep Kaur List-Id: xen-devel@lists.xenproject.org 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 --- Cc: Ian Campbell Cc: Ian Jackson Cc: Dario Faggioli Cc: Harmandeep Kaur Cc: Andrew Cooper v2: print rc. --- tools/libxl/xl_cmdimpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 2756d2f..9b6b42c 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -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; } -- 2.1.4