@@ -1653,10 +1653,8 @@ void libxl__destroy_domid(libxl__egc *egc, libxl__destroy_domid_state *dis)
}
if (dm_present) {
- if (libxl__destroy_device_model(gc, domid) < 0)
- LOG(ERROR, "libxl__destroy_device_model failed for %d", domid);
+ libxl__destroy_device_model(gc, domid);
- libxl__qmp_cleanup(gc, domid);
}
dis->drs.ao = ao;
dis->drs.domid = domid;
@@ -2099,13 +2099,21 @@ out:
int libxl__destroy_device_model(libxl__gc *gc, uint32_t domid)
{
+ int rc;
+
char *path = libxl__device_model_xs_path(gc, LIBXL_TOOLSTACK_DOMID,
domid, EMUID_DM, "");
if (!xs_rm(CTX->xsh, XBT_NULL, path))
LOG(ERROR, "xs_rm failed for %s", path);
/* We should try to destroy the device model anyway. */
- return kill_device_model(gc,
+ rc = kill_device_model(gc,
GCSPRINTF("/local/domain/%d/image/device-model-pid", domid));
+ if (rc)
+ LOG(ERROR, "libxl__destroy_device_model failed for %d",
+ domid);
+
+ libxl__qmp_cleanup(gc, domid);
+ return rc;
}
int libxl__need_xenpv_qemu(libxl__gc *gc,
Move - the error log message - the call to libxl__qmp_cleanup into libxl__destroy_device_model from the one call site in libxl__destroy_domid. We are going to want to call libxl__destroy_device_model more than once, and this code would otherwise need to be repeated for the other call site(s). The call site now completely ignores the error, sadly. But I am not intending in this series to try to undertake destruction error-handling cleanup as well. No functional change other than slight change to the error message. Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> --- v6: New patch. --- tools/libxl/libxl.c | 4 +--- tools/libxl/libxl_dm.c | 10 +++++++++- 2 files changed, 10 insertions(+), 4 deletions(-)