diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-15 13:32:22 +0000 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2013-02-15 13:32:22 +0000 |
commit | e6b5f709c382be7a0fada1ca3896494413b0bf3c (patch) | |
tree | 49f21d97b122bc58770527bf8482d70b20deba30 /tools/libxl/libxl_x86.c | |
parent | c967d12820716b3836a0ea3c1076fa20dd3314ee (diff) | |
download | xen-e6b5f709c382be7a0fada1ca3896494413b0bf3c.tar.gz xen-e6b5f709c382be7a0fada1ca3896494413b0bf3c.tar.bz2 xen-e6b5f709c382be7a0fada1ca3896494413b0bf3c.zip |
xen/arm: compile and run libxl/xl
Move tsc, rtc, memmap_limit, localtime and shadow settings from
libxl__build_pre to libxl__arch_domain_create.
Get the console and xenstore pfn's from struct xc_dom_image for
autotranslated guests.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_x86.c')
-rw-r--r-- | tools/libxl/libxl_x86.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c index 590e39dc9a..a17f6ae63b 100644 --- a/tools/libxl/libxl_x86.c +++ b/tools/libxl/libxl_x86.c @@ -248,6 +248,54 @@ int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config *d_config, uint32_t domid) { int ret = 0; + int tsc_mode; + uint32_t rtc_timeoffset; + libxl_ctx *ctx = libxl__gc_owner(gc); + + if (d_config->b_info.type == LIBXL_DOMAIN_TYPE_PV) + xc_domain_set_memmap_limit(ctx->xch, domid, + (d_config->b_info.max_memkb + + d_config->b_info.u.pv.slack_memkb)); + + switch (d_config->b_info.tsc_mode) { + case LIBXL_TSC_MODE_DEFAULT: + tsc_mode = 0; + break; + case LIBXL_TSC_MODE_ALWAYS_EMULATE: + tsc_mode = 1; + break; + case LIBXL_TSC_MODE_NATIVE: + tsc_mode = 2; + break; + case LIBXL_TSC_MODE_NATIVE_PARAVIRT: + tsc_mode = 3; + break; + default: + abort(); + } + xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0); + if (libxl_defbool_val(d_config->b_info.disable_migrate)) + xc_domain_disable_migrate(ctx->xch, domid); + rtc_timeoffset = d_config->b_info.rtc_timeoffset; + if (libxl_defbool_val(d_config->b_info.localtime)) { + time_t t; + struct tm *tm; + + t = time(NULL); + tm = localtime(&t); + + rtc_timeoffset += tm->tm_gmtoff; + } + + if (rtc_timeoffset) + xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset); + + if (d_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) { + unsigned long shadow; + shadow = (d_config->b_info.shadow_memkb + 1023) / 1024; + xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION, NULL, 0, &shadow, 0, NULL); + } + if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV && libxl_defbool_val(d_config->b_info.u.pv.e820_host)) { ret = libxl__e820_alloc(gc, domid, d_config); |