From: Marek Marczykowski-Górecki <marma...@invisiblethingslab.com> Since qemu-xen can now run in stubdomain too, handle this case when checking it's state too.
Signed-off-by: Marek Marczykowski-Górecki <marma...@invisiblethingslab.com> Reviewed-by: Jason Andryuk <jandr...@gmail.com> Signed-off-by: Jason Andryuk <jandr...@gmail.com> Acked-by: Ian Jackson <ian.jack...@eu.citrix.com> --- Changes in v6: - Add Acked-by: Ian Jackson --- tools/libxl/libxl_dm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 3356880346..098dc49ecb 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -3744,12 +3744,18 @@ out: int libxl__dm_active(libxl__gc *gc, uint32_t domid) { - char *pid, *path; + char *pid, *dm_domid, *path; path = GCSPRINTF("/local/domain/%d/image/device-model-pid", domid); pid = libxl__xs_read(gc, XBT_NULL, path); - return pid != NULL; + if (pid) + return true; + + path = GCSPRINTF("/local/domain/%d/image/device-model-domid", domid); + dm_domid = libxl__xs_read(gc, XBT_NULL, path); + + return dm_domid != NULL; } int libxl__dm_check_start(libxl__gc *gc, libxl_domain_config *d_config, -- 2.25.1