]> xenbits.xensource.com Git - libvirt.git/commitdiff
libxl_migration: Resolve Coverity NULL_RETURNS
authorJohn Ferlan <jferlan@redhat.com>
Thu, 28 Aug 2014 18:56:33 +0000 (14:56 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 28 Aug 2014 18:59:56 +0000 (14:59 -0400)
Coverity noted that all callers to libxlDomainEventQueue() could ensure
the second parameter (event) was true before calling except this case.
As I look at the code and how events are used - it seems that prior to
generating an event for the dom == NULL condition, the resume/suspend
event should be queue'd after the virDomainSaveStatus() call which will
goto cleanup and queue the saved event anyway.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/libxl/libxl_migration.c

index d7a380e4addc9a28c269995e4136b3dc8a2fe2fb..b5d8edfcb75b20948e36f729750dddcd2e327e2f 100644 (file)
@@ -515,6 +515,11 @@ libxlDomainMigrationFinish(virConnectPtr dconn,
     if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm) < 0)
         goto cleanup;
 
+    if (event) {
+        libxlDomainEventQueue(driver, event);
+        event = NULL;
+    }
+
     dom = virGetDomain(dconn, vm->def->name, vm->def->uuid);
 
     if (dom == NULL) {