diff options
author | George Dunlap <george.dunlap@eu.citrix.com> | 2012-12-06 10:19:08 +0000 |
---|---|---|
committer | George Dunlap <george.dunlap@eu.citrix.com> | 2012-12-06 10:19:08 +0000 |
commit | d7942d1dbe5d98cef71c00c51f2826eefb9273d0 (patch) | |
tree | 3a34cc02873e6c66c59a5f4830ce0dacdc9893f9 /tools/libxc/xc_domain_restore.c | |
parent | f60d158a02165aac0eb824106f0655589b4f683e (diff) | |
download | xen-d7942d1dbe5d98cef71c00c51f2826eefb9273d0.tar.gz xen-d7942d1dbe5d98cef71c00c51f2826eefb9273d0.tar.bz2 xen-d7942d1dbe5d98cef71c00c51f2826eefb9273d0.zip |
libxl: Make an internal function explicitly check existence of expected paths
libxl__device_disk_from_xs_be() was failing without error for some
missing xenstore nodes in a backend, while assuming (without checking)
that other nodes were valid, causing a crash when another internal
error wrote these nodes in the wrong place.
Make this function consistent by:
* Checking the existence of all nodes before using
* Choosing a default only when the node is not written in device_disk_add()
* Failing with log msg if any node written by device_disk_add() is not present
* Returning an error on failure
* Disposing of the structure before returning using libxl_device_disk_displose()
Also make the callers of the function pay attention to the error and
behave appropriately. In the case of libxl__append_disk_list_of_type(),
this means only incrementing *ndisks as the disk structures are
successfully initialized.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxc/xc_domain_restore.c')
0 files changed, 0 insertions, 0 deletions