]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commit
libxl: do not overwrite user supplied config when running bootloader
authorIan Campbell <Ian.Campbell@citrix.com>
Tue, 29 May 2012 09:31:38 +0000 (10:31 +0100)
committerIan Campbell <Ian.Campbell@citrix.com>
Tue, 29 May 2012 09:31:38 +0000 (10:31 +0100)
commit877242bad23efaa7e1e8484bddc8b2ea702950d0
treec37e57bf326bf01a3ac09da3c30041ad726fe292
parent9328cd80a4c8a81809b46f68c56e4f7c87d2243c
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>
15 files changed:
tools/libxl/gentest.py
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl_bootloader.c
tools/libxl/libxl_create.c
tools/libxl/libxl_dm.c
tools/libxl/libxl_dom.c
tools/libxl/libxl_internal.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_json.c
tools/libxl/libxl_json.h
tools/libxl/libxl_types.idl
tools/libxl/xl_cmdimpl.c
tools/libxl/xl_sxp.c
tools/python/xen/lowlevel/xl/xl.c