@@ -1507,7 +1507,9 @@ static void domcreate_devmodel_started(libxl__egc *egc,
if (dcs->sdss.dm.guest_domid) {
if (d_config->b_info.device_model_version
== LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
- libxl__qmp_initializations(gc, domid, d_config);
+ ret = libxl__qmp_initializations(gc, domid, d_config);
+ if (ret == ERROR_BADFAIL)
+ goto error_out;
}
}
@@ -1175,11 +1175,12 @@ int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
{
const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
libxl__qmp_handler *qmp = NULL;
- int ret = 0;
+ bool ignore_error = true;
+ int ret = -1;
qmp = libxl__qmp_initialize(gc, domid);
if (!qmp)
- return -1;
+ goto out;
ret = libxl__qmp_query_serial(qmp);
if (!ret && vnc && vnc->passwd) {
ret = qmp_change(gc, qmp, "vnc", "password", vnc->passwd);
@@ -1189,7 +1190,9 @@ int libxl__qmp_initializations(libxl__gc *gc, uint32_t domid,
ret = qmp_query_vnc(qmp);
}
libxl__qmp_close(qmp);
- return ret;
+
+ out:
+ return ret ? (ignore_error ? ERROR_FAIL : ERROR_BADFAIL) : 0;
}
/*
If some errors happening during QMP initialization can affect the proper work of a domain, it'd be better to treat them as fatal errors and abort the creation of that domain. The existing types of QMP initialization errors are not treated as fatal, and do not abort the domain creation as before. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> --- Cc: Ian Jackson <ian.jackson@eu.citrix.com> Cc: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/libxl_create.c | 4 +++- tools/libxl/libxl_qmp.c | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-)