libxl: Check stubdomain kernel & ramdisk presence
authorJason Andryuk <jandryuk@gmail.com>
Tue, 19 May 2020 01:55:03 +0000 (21:55 -0400)
committerWei Liu <wl@xen.org>
Tue, 19 May 2020 15:19:15 +0000 (16:19 +0100)
commite235fa2794c95365519eac714d6ea82f8e64752e
treef54282716f68bdae0648240b52062b74810b7214
parentb6af49af6093a9a0e0e0b4d39ab06da106f4bdf7
libxl: Check stubdomain kernel & ramdisk presence

Just out of context is the following comment for libxl__domain_make:
/* fixme: this function can leak the stubdom if it fails */

When the stubdomain kernel or ramdisk is not present, the domid and
stubdomain name will indeed be leaked.  Avoid the leak by checking the
file presence and erroring out when absent.  It doesn't fix all cases,
but it avoids a big one when using a linux device model stubdomain.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_dm.c