[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v6 09/29] libxl: switch HVM domain building to use xc_dom_* helpers



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é <roger.pau@xxxxxxxxxx>
> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> 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 = libxl__gc_owner(gc);
> -    struct xc_hvm_build_args args = {};
> -    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 = &d_config->b_info;
> +    struct xc_dom_image *dom = NULL;
> +
> +    xc_dom_loginit(ctx->xch);
> +
> +    dom = 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 != 0);
> +    if (dom != NULL) xc_dom_release(dom);
>      return rc;
>  }
>  

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.