[PATCH 2/2] libxl: Resolve Coverity CHECKED_RETURN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Periodically my Coverity scan will return a checked_return failure
for libxlDomainShutdownThread call to libxlDomainStart. Followed the
libxlAutostartDomain example in order to check the status, emit a
message, and continue on.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/libxl/libxl_domain.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index f0eaf6c..21c41d7 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -685,7 +685,11 @@ libxlDomainShutdownThread(void *opaque)
     }
     libxl_domain_destroy(ctx, vm->def->id, NULL);
     libxlDomainCleanupJob(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN);
-    libxlDomainStart(driver, vm, 0, -1);
+    if (libxlDomainStart(driver, vm, false, -1) < 0) {
+        virErrorPtr err = virGetLastError();
+        VIR_ERROR(_("Failed to restart VM '%s': %s"),
+                  vm->def->name, err ? err->message : _("unknown error"));
+    }
 
  cleanup:
     if (vm)
-- 
2.1.0

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]