mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
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>
This commit is contained in:
1 parent
8d7aec4154
commit
731a050623
15 files changed
+130
-179
No files matched your search
@@ -243,11 +243,6 @@ int attrib__libxl_cpumap_set(PyObject *v, libxl_cpumap *pptr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int attrib__libxl_file_reference_set(PyObject *v, libxl_file_reference *pptr)
|
||||
{
|
||||
return genwrap__string_set(v, &pptr->path);
|
||||
}
|
||||
|
||||
int attrib__libxl_hwcap_set(PyObject *v, libxl_hwcap *pptr)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Setting hwcap");
|
||||
@@ -315,11 +310,6 @@ PyObject *attrib__libxl_cpumap_get(libxl_cpumap *pptr)
|
||||
return cpulist;
|
||||
}
|
||||
|
||||
PyObject *attrib__libxl_file_reference_get(libxl_file_reference *pptr)
|
||||
{
|
||||
return genwrap__string_get(&pptr->path);
|
||||
}
|
||||
|
||||
PyObject *attrib__libxl_hwcap_get(libxl_hwcap *pptr)
|
||||
{
|
||||
PyErr_SetString(PyExc_NotImplementedError, "Getting hwcap");
|
||||
|
||||