diff options
author | Ross Philipson <ross.philipson@citrix.com> | 2013-02-15 13:32:16 +0000 |
---|---|---|
committer | Ross Philipson <ross.philipson@citrix.com> | 2013-02-15 13:32:16 +0000 |
commit | a234675150adfca751ed36c0ef68712160ff1ab9 (patch) | |
tree | c143d617122aa6746e46f58b351a1bb75e5bed46 /tools | |
parent | 86baa64d950d36bf8abc051aab660f79e8632819 (diff) | |
download | xen-a234675150adfca751ed36c0ef68712160ff1ab9.tar.gz xen-a234675150adfca751ed36c0ef68712160ff1ab9.tar.bz2 xen-a234675150adfca751ed36c0ef68712160ff1ab9.zip |
libxl: switch to using the new xc_hvm_build() libxc API.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/libxl_dom.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 6b3b3c3e19..33ae5583d8 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -542,17 +542,24 @@ 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 = ERROR_FAIL; const char *firmware = libxl__domain_firmware(gc, info); if (!firmware) goto out; - ret = xc_hvm_build_target_mem( - ctx->xch, - domid, - (info->max_memkb - info->video_memkb) / 1024, - (info->target_memkb - info->video_memkb) / 1024, - firmware); + + memset(&args, 0, sizeof(struct xc_hvm_build_args)); + /* The params from the configuration file are in Mb, which are then + * multiplied by 1 Kb. This was then divided off when calling + * the old xc_hvm_build_target_mem() which then turned them to bytes. + * Do all this in one step here... + */ + args.mem_size = (uint64_t)(info->max_memkb - info->video_memkb) << 10; + args.mem_target = (uint64_t)(info->target_memkb - info->video_memkb) << 10; + args.image_file_name = firmware; + + ret = xc_hvm_build(ctx->xch, domid, &args); if (ret) { LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, ret, "hvm building failed"); goto out; |