From: Wei Liu Subject: [PATCH for-4.6] libxl: move calling libxl__arch_domain_construct_memmap to right place Date: Wed, 5 Aug 2015 11:23:18 +0100 Message-ID: <1438770198-5581-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZMvr5-0003IC-9X for xen-devel@lists.xenproject.org; Wed, 05 Aug 2015 10:23:27 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , "Chen, Tiejun" , Wei Liu , Ian Campbell List-Id: xen-devel@lists.xenproject.org This function was called in the wrong place, because both libxl__vnuma_build_vmemrange_hvm and xc_hvm_build rely on its output. Move the call of said function to the right place -- before the other two functions which reply on its output. Signed-off-by: Wei Liu --- Cc: "Chen, Tiejun" Cc: Ian Campbell Cc: Ian Jackson Discovered this issue by code inspection. This issue is not discovered by osstest because we don't have hardware or test case to test that code path. Tiejun, can you confirm this is the right fix? Can you test this change? --- tools/libxl/libxl_dom.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 5555fea..811f7da 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -960,6 +960,11 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid, goto out; } + if (libxl__arch_domain_construct_memmap(gc, d_config, domid, &args)) { + LOG(ERROR, "setting domain memory map failed"); + goto out; + } + if (info->num_vnuma_nodes != 0) { int i; @@ -997,11 +1002,6 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid, goto out; } - if (libxl__arch_domain_construct_memmap(gc, d_config, domid, &args)) { - LOG(ERROR, "setting domain memory map failed"); - goto out; - } - ret = hvm_build_set_params(ctx->xch, domid, info, state->store_port, &state->store_mfn, state->console_port, &state->console_mfn, state->store_domid, -- 2.4.6