]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
libxl: Resolve Coverity CHECKED_RETURN
authorJohn Ferlan <jferlan@redhat.com>
Fri, 13 Feb 2015 20:09:09 +0000 (15:09 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Sat, 14 Feb 2015 12:31:41 +0000 (07:31 -0500)
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.

src/libxl/libxl_domain.c

index f0eaf6c671dee9f1790a0e74290520c1e2f34b16..21c41d7424daecc876485215e877586e36ad2fa9 100644 (file)
@@ -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)