aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_create.c
diff options
context:
space:
mode:
authorTim Deegan <tim@xen.org>2013-03-14 12:39:39 +0000
committerIan Jackson <Ian.Jackson@eu.citrix.com>2013-03-28 15:51:39 +0000
commit650354dbc2626b643c12873275ca67782f1382c8 (patch)
treee0bef56927c688c23470f7a1639e95cfb359f928 /tools/libxl/libxl_create.c
parenta5c800142cfc82159fcb85b47116cf296caebcc5 (diff)
downloadxen-650354dbc2626b643c12873275ca67782f1382c8.tar.gz
xen-650354dbc2626b643c12873275ca67782f1382c8.tar.bz2
xen-650354dbc2626b643c12873275ca67782f1382c8.zip
libxl: run libxl__arch_domain_create() much earlier.
Among other things, arch_domain_create() sets the shadow(/hap/p2m) memory allocation, which must happen after vcpus are assigned (or the shadow op will fail) but before memory is allocated (or we might run out of p2m memory). libxl__build_pre(), which already sets similar things like maxmem, semes like a reasonable spot for it. That needed a bit of plumbing to get the right datastructure from the caller. As a side-effect, the return code from libxl__arch_domain_create() is no longer ignored. This bug was analysed in: From: "Jan Beulich" <JBeulich@xxxxxxxx> "Re: [Xen-devel] [xen-unstable test] 16788: regressions - FAIL" Date: Mon, 04 Mar 2013 16:34:53 +0000 http://lists.xen.org/archives/html/xen-devel/2013-03/msg00191.html Reported-by: Jan Beulich <JBeulich@suse.com> Signed-off-by: Tim Deegan <tim@xen.org> Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_create.c')
-rw-r--r--tools/libxl/libxl_create.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 2ea628a893..30a4507dfc 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -315,15 +315,16 @@ static int init_console_info(libxl__device_console *console, int dev_num)
}
int libxl__domain_build(libxl__gc *gc,
- libxl_domain_build_info *info,
+ libxl_domain_config *d_config,
uint32_t domid,
libxl__domain_build_state *state)
{
+ libxl_domain_build_info *const info = &d_config->b_info;
char **vments = NULL, **localents = NULL;
struct timeval start_time;
int i, ret;
- ret = libxl__build_pre(gc, domid, info, state);
+ ret = libxl__build_pre(gc, domid, d_config, state);
if (ret)
goto out;
@@ -750,14 +751,14 @@ static void domcreate_bootloader_done(libxl__egc *egc,
dcs->dmss.callback = domcreate_devmodel_started;
if ( restore_fd < 0 ) {
- rc = libxl__domain_build(gc, &d_config->b_info, domid, state);
+ rc = libxl__domain_build(gc, d_config, domid, state);
domcreate_rebuild_done(egc, dcs, rc);
return;
}
/* Restore */
- rc = libxl__build_pre(gc, domid, info, state);
+ rc = libxl__build_pre(gc, domid, d_config, state);
if (rc)
goto out;
@@ -1169,7 +1170,6 @@ static void domcreate_attach_pci(libxl__egc *egc, libxl__multidev *multidev,
}
}
- libxl__arch_domain_create(gc, d_config, domid);
domcreate_console_available(egc, dcs);
domcreate_complete(egc, dcs, 0);