From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony PERARD Subject: Re: [PATCH v6 09/29] libxl: switch HVM domain building to use xc_dom_* helpers Date: Fri, 18 Sep 2015 16:53:31 +0100 Message-ID: <20150918155331.GJ2104@perard.uk.xensource.com> References: <1441368548-43465-1-git-send-email-roger.pau@citrix.com> <1441368548-43465-10-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zcxz5-0002iE-Hg for xen-devel@lists.xenproject.org; Fri, 18 Sep 2015 15:53:59 +0000 Content-Disposition: inline In-Reply-To: <1441368548-43465-10-git-send-email-roger.pau@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: Roger Pau Monne Cc: xen-devel@lists.xenproject.org, Ian Campbell , Wei Liu , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org 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 used= 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:. > + goto out; > + } > + [...] > = > + xc_dom_release(dom); > return 0; > + > out: > assert(rc !=3D 0); > + if (dom !=3D NULL) xc_dom_release(dom); > return rc; > } > = -- = Anthony PERARD