From: Dario Faggioli <dario.faggioli@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Keir Fraser <keir@xen.org>,
Ian Campbell <Ian.Campbell@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Xen-devel <xen-devel@lists.xen.org>,
Euan Harris <euan.harris@citrix.com>,
Jan Beulich <jbeulich@suse.com>, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH for-4.5 v3] Xen and tools: Fix listing of vcpus when domains lacking any vcpus exist
Date: Wed, 22 Oct 2014 18:18:43 +0200 [thread overview]
Message-ID: <1413994723.17454.10.camel@Abyss> (raw)
In-Reply-To: <1413910014-4249-1-git-send-email-andrew.cooper3@citrix.com>
[-- Attachment #1.1: Type: text/plain, Size: 1427 bytes --]
On Tue, 2014-10-21 at 17:46 +0100, Andrew Cooper wrote:
> As part of this change, remove the pointless call to libxl_get_max_cpus(),
> whose returned value is unconditionally clobbered in the for() loop.
>
Is it? You mind pointing me at where?
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index f27b581..ee127d8 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -5246,7 +5246,12 @@ libxl_vcpuinfo *libxl_list_vcpu(libxl_ctx *ctx, uint32_t domid,
> GC_FREE;
> return NULL;
> }
> - *nr_cpus_out = libxl_get_max_cpus(ctx);
>
I may be wrong, but the only other occurrence of nr_cpus_out, which is
where the result from libxl_get_max_cpus() is stored, seems to be in the
parameter list of the function.
About the for, here's how it looks like here:
for (*nr_vcpus_out = 0;
*nr_vcpus_out <= domaininfo.max_vcpu_id;
++*nr_vcpus_out, ++ptr) {
I.e., it uses nr_vcpus_out. Note: _v_cpus, different from _p_cpus.
Without such call, callers that expect to see the parameter filled with
the maximum possible number of _P_CPUs, will break!
Regards,
Dario
--
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2014-10-22 16:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 16:46 [PATCH for-4.5 v3] Xen and tools: Fix listing of vcpus when domains lacking any vcpus exist Andrew Cooper
2014-10-21 17:09 ` Don Slutz
2014-10-22 11:27 ` Ian Campbell
2014-10-22 16:18 ` Dario Faggioli [this message]
2014-10-22 16:27 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413994723.17454.10.camel@Abyss \
--to=dario.faggioli@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=euan.harris@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.