From d074d42a47b4f3de772755e4df914fa78009d7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 6 Sep 2019 16:12:55 +0200 Subject: [PATCH] libxl: Fix libxlDomainPMSuspendForDuration domain active check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit virDomainObjCheckActive() returns -1 if domain is not active, not 0. Fixes cb50436c6f "libxl: implement virDomainPM* functions" Reviewed-by: Daniel P. Berrangé Signed-off-by: Marek Marczykowski-Górecki --- src/libxl/libxl_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index d0396e4781..215471fa0d 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -1459,7 +1459,7 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom, if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0) goto cleanup; - if (!virDomainObjCheckActive(vm)) + if (virDomainObjCheckActive(vm) < 0) goto endjob; /* Unlock virDomainObjPtr to not deadlock with even handler, which will try -- GitLab