From: Wei Liu Subject: Re: [PATCH for-4.5 v2 2/2] tools/[lib]xl: Fix `xl vcpu-list` when domains without vcpus exist Date: Tue, 21 Oct 2014 14:11:43 +0100 Message-ID: <20141021131143.GD10234@zion.uk.xensource.com> References: <1413822093-1621-3-git-send-email-andrew.cooper3@citrix.com> <1413823134-2237-1-git-send-email-andrew.cooper3@citrix.com> <20141021130632.GC10234@zion.uk.xensource.com> <54465AD5.5020209@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <54465AD5.5020209@citrix.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: Andrew Cooper Cc: Ian Jackson , Wei Liu , Ian Campbell , Xen-devel List-Id: xen-devel@lists.xenproject.org On Tue, Oct 21, 2014 at 02:08:37PM +0100, Andrew Cooper wrote: [...] > >> GC_FREE; > >> return NULL; > >> } > >> - *nr_cpus_out = libxl_get_max_cpus(ctx); > >> + > >> + if (domaininfo.max_vcpu_id == XEN_INVALID_MAX_VCPU_ID) { > >> + *nr_cpus_out = 0; > > Do you not need to set nr_vcpus_out to 0 as well? > > Hmm - probably not. NULL should do. > Just setting one out parameter not the other looks a bit odd to me. Nothing fundamental wrong with that though, as you said, it's mostly the NULL return value indicates failure. Wei.