Am Tue, 14 May 2019 10:05:58 +0200 schrieb Olaf Hering : > @@ -459,7 +461,9 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel) > goto out; > } > > - if (type == LIBXL_DOMAIN_TYPE_HVM) { > + if (type == LIBXL_DOMAIN_TYPE_HVM || > + libxl__device_model_version_running(gc, domid) == > + LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { > rc = libxl__domain_resume_device_model(gc, domid); > if (rc) { > LOGD(ERROR, domid, "failed to resume device model:%d", rc); I think this could be done like that instead, so that libxl__device_model_version_running is called just once: --- a/tools/libxl/libxl_dom_suspend.c +++ b/tools/libxl/libxl_dom_suspend.c @@ -444,6 +444,8 @@ int libxl__domain_resume_device_model(libxl__gc *gc, uint32_t domid) if (libxl__qmp_resume(gc, domid)) return ERROR_FAIL; break; + case LIBXL_DEVICE_MODEL_VERSION_NONE: + break; default: return ERROR_INVAL; } @@ -461,14 +463,10 @@ int libxl__domain_resume(libxl__gc *gc, uint32_t domid, int suspend_cancel) goto out; } - if (type == LIBXL_DOMAIN_TYPE_HVM || - libxl__device_model_version_running(gc, domid) == - LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) { - rc = libxl__domain_resume_device_model(gc, domid); - if (rc) { - LOGD(ERROR, domid, "failed to resume device model:%d", rc); - goto out; - } + rc = libxl__domain_resume_device_model(gc, domid); + if (rc) { + LOGD(ERROR, domid, "failed to resume device model:%d", rc); + goto out; } if (xc_domain_resume(CTX->xch, domid, suspend_cancel)) { While it is easy for the resume path, doing the same in the suspend path needs more changes. libxl__domain_suspend_device_model would need to receive the callback and set it if a device model is active. Should this be done on top of this change? Olaf