aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.h
diff options
context:
space:
mode:
authorIan Campbell <Ian.Campbell@citrix.com>2012-05-29 10:31:38 +0100
committerIan Campbell <Ian.Campbell@citrix.com>2012-05-29 10:31:38 +0100
commit731a050623bd2a10a4d48176da3a79fb549d8114 (patch)
tree2c715eb78bab736c32aa3f327253a629900461a6 /tools/libxl/libxl.h
parent8d7aec41547d798761dcb308387f276667f9989a (diff)
downloadxen-731a050623bd2a10a4d48176da3a79fb549d8114.tar.gz
xen-731a050623bd2a10a4d48176da3a79fb549d8114.tar.bz2
xen-731a050623bd2a10a4d48176da3a79fb549d8114.zip
libxl: do not overwrite user supplied config when running bootloader
Currently when running the bootloader libxl will update b_info->u.pv.kernel, .ramdisk, .cmdline and .bootloader. This can expose internal details, such as temporary paths in /var/run/xen/bootloader.*/ to the user. This is problematic because it means that the user cannot re-use the struct as is. This does not effect xl in Xen 4.2+ since it always reparses the guest config and reinitialises the build info, however it did cause issues with reboot in 4.1 (reported by Dmitry Morozhnikov) and may cause issues for other users of libxl. Instead make the libxl bootloader infrastructure provide output to its caller which is slurped into the internal libxl__domain_build_state datastructure. If no bootloader is configured then the bootloader instead propagates the user supplied b_info config. In order to simplify this push the error handling for the case where there is no bootdisk down into libxl__bootloader_run. In principal there is no reason why it shouldn't be possible to do a pure netboot guest with a suitable bootloader, but I don't fix that here. This change allow us to make the libxl_file_reference an internal API, and eventually we might be able to get rid of it. Also removes the publix libxl_run_bootloader interface, neither xl nor libvirt use it. I am proposing this for 4.2 due to the API change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> [ ijc -- reduced log message in libxl__build_pv from INFO to DEBUG ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl.h')
-rw-r--r--tools/libxl/libxl.h36
1 files changed, 2 insertions, 34 deletions
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 316d290579..48c87d3eff 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -288,18 +288,6 @@ typedef struct {
} libxl_cpumap;
void libxl_cpumap_dispose(libxl_cpumap *map);
-typedef struct {
- /*
- * Path is always set if the file reference is valid. However if
- * mapped is true then the actual file may already be unlinked.
- */
- char * path;
- int mapped;
- void * data;
- size_t size;
-} libxl_file_reference;
-void libxl_file_reference_dispose(libxl_file_reference *p);
-
/* libxl_cpuid_policy_list is a dynamic array storing CPUID policies
* for multiple leafs. It is terminated with an entry holding
* XEN_CPUID_INPUT_UNUSED in input[0]
@@ -421,7 +409,8 @@ enum {
* of course check the rc value for errors.
*
* *ao_how does not need to remain valid after the initiating function
- * returns.
+ * returns. All other parameters must remain valid for the lifetime of
+ * the asynchronous operation, unless otherwise specified.
*
* Callbacks may occur on any thread in which the application calls
* libxl.
@@ -543,27 +532,6 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid, libxl_domain_create_in
/* get max. number of cpus supported by hypervisor */
int libxl_get_max_cpus(libxl_ctx *ctx);
-/*
- * Run the configured bootloader for a PV domain and update
- * info->kernel, info->u.pv.ramdisk and info->u.pv.cmdline as
- * appropriate (any initial values present in these fields must have
- * been allocated with malloc).
- *
- * Is a NOP on non-PV domains or those with no bootloader configured.
- *
- * Users should call libxl_file_reference_unmap on the kernel and
- * ramdisk to cleanup or rely on libxl_domain_{build,restore} to do
- * it.
- */
-int libxl_run_bootloader(libxl_ctx *ctx,
- libxl_domain_build_info *info,
- libxl_device_disk *disk,
- uint32_t domid,
- libxl_asyncop_how *ao_how);
-
- /* 0 means ERROR_ENOMEM, which we have logged */
-
-
int libxl_domain_rename(libxl_ctx *ctx, uint32_t domid,
const char *old_name, const char *new_name);