[libvirt] [PATCH] libxl: Fix libxlDomainPMSuspendForDuration domain active check

Marek Marczykowski-Górecki posted 1 patch 5 years, 2 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20190906141255.GA21192@mail-itl
src/libxl/libxl_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] libxl: Fix libxlDomainPMSuspendForDuration domain active check
Posted by Marek Marczykowski-Górecki 5 years, 2 months ago
virDomainObjCheckActive() returns -1 if domain is not active, not 0.

Fixes cb50436c6f "libxl: implement virDomainPM* functions"
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 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
-- 
2.21.0
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] libxl: Fix libxlDomainPMSuspendForDuration domain active check
Posted by Daniel P. Berrangé 5 years, 2 months ago
On Fri, Sep 06, 2019 at 04:12:55PM +0200, Marek Marczykowski-Górecki wrote:
> virDomainObjCheckActive() returns -1 if domain is not active, not 0.
> 
> Fixes cb50436c6f "libxl: implement virDomainPM* functions"
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  src/libxl/libxl_driver.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

and pushed to git


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list