From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] libxl: avoid bringing up vcpus already online Date: Mon, 17 Nov 2014 10:29:19 +0000 Message-ID: <1416220159.27385.20.camel@citrix.com> References: <1416216538-15926-1-git-send-email-chao.p.peng@linux.intel.com> <20141117094117.GF11070@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20141117094117.GF11070@zion.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Wei Liu Cc: Anthony Perard , Chao Peng , Stefano Stabellini , Ian Jackson , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2014-11-17 at 09:41 +0000, Wei Liu wrote: > On Mon, Nov 17, 2014 at 05:28:58PM +0800, Chao Peng wrote: > > Avoid sending duplicated qmp commands and eliminate the confusing error > > messages like "Unable to add CPU: 0, it already exists". > > > > Signed-off-by: Chao Peng > > --- > > tools/libxl/libxl.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > > index f7961f6..d040e5c 100644 > > --- a/tools/libxl/libxl.c > > +++ b/tools/libxl/libxl.c > > @@ -5450,7 +5450,7 @@ static int libxl__set_vcpuonline_qmp(libxl__gc *gc, uint32_t domid, > > LOGE(ERROR, "getting domain info list"); > > return ERROR_FAIL; > > } > > - for (i = 0; i <= info.vcpu_max_id; i++) { > > + for (i = info.vcpu_online; i <= info.vcpu_max_id; i++) { > > I don't think this is right. You're making an assumption that vcpu 0 to > vcpu "info.vcpu_online" are online, which might not be true in hotplug / > hot-unplug scenario. Indeed. Adding Anthony for his input. > > Wei. > > > if (libxl_bitmap_test(cpumap, i)) { > > /* Return value is ignore because it does not tell anything useful > > * on the completion of the command. > > -- > > 1.7.9.5