From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Subject: Re: [PATCH v6 09/29] libxl: switch HVM domain building to use xc_dom_* helpers Date: Wed, 23 Sep 2015 12:38:07 +0200 Message-ID: <5602810F.2080406@citrix.com> References: <1441368548-43465-1-git-send-email-roger.pau@citrix.com> <1441368548-43465-10-git-send-email-roger.pau@citrix.com> <20150918155331.GJ2104@perard.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZehRF-0007wE-E1 for xen-devel@lists.xenproject.org; Wed, 23 Sep 2015 10:38:13 +0000 In-Reply-To: <20150918155331.GJ2104@perard.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: Anthony PERARD Cc: xen-devel@lists.xenproject.org, Ian Campbell , Wei Liu , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org El 18/09/15 a les 17.53, Anthony PERARD ha escrit: > On Fri, Sep 04, 2015 at 02:08:48PM +0200, Roger Pau Monne wrote: >> Now that we have all the code in place HVM domain building in libxl can = be >> switched to use the xc_dom_* family of functions, just like they are use= d in >> order to build PV guests. >> >> Signed-off-by: Roger Pau Monn=E9 >> Acked-by: Wei Liu >> Cc: Ian Jackson >> Cc: Stefano Stabellini >> Cc: Ian Campbell >> Cc: Wei Liu >> --- >> Changes since v4: >> - Add Wei Liu Acked-by. >> --- >> tools/libxl/libxl_arch.h | 2 +- >> tools/libxl/libxl_dm.c | 18 ++-- >> tools/libxl/libxl_dom.c | 227 +++++++++++++++++++++++++-----------= ------- >> tools/libxl/libxl_internal.h | 4 +- >> tools/libxl/libxl_vnuma.c | 12 ++- >> tools/libxl/libxl_x86.c | 8 +- >> 6 files changed, 155 insertions(+), 116 deletions(-) > = > = >> diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c >> index 6101e5c..d2cf9e3 100644 >> --- a/tools/libxl/libxl_dom.c >> +++ b/tools/libxl/libxl_dom.c >> @@ -912,52 +935,62 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid, >> libxl__domain_build_state *state) >> { >> libxl_ctx *ctx =3D libxl__gc_owner(gc); >> - struct xc_hvm_build_args args =3D {}; >> - int ret, rc; >> - uint64_t mmio_start, lowmem_end, highmem_end; >> + int rc; >> + uint64_t mmio_start, lowmem_end, highmem_end, mem_size; >> libxl_domain_build_info *const info =3D &d_config->b_info; >> + struct xc_dom_image *dom =3D NULL; >> + >> + xc_dom_loginit(ctx->xch); >> + >> + dom =3D xc_dom_allocate(ctx->xch, NULL, NULL); >> + if (!dom) { >> + LOGE(ERROR, "xc_dom_allocate failed"); > = > 'rc' is uninitialized at this point and is going to be used in out:. Yes, I'm sorry, I have no idea how I missed it. Anyway, as you say this is missing: rc =3D ERROR_NOMEM; before the goto. Roger.