From: John Ferlan Date: Thu, 28 Aug 2014 18:56:33 +0000 (-0400) Subject: libxl_migration: Resolve Coverity NULL_RETURNS X-Git-Tag: v1.2.8-rc2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0322643ed57a7ed2f301af9b429f7183f5c4b9c6;p=thirdparty%2Flibvirt.git libxl_migration: Resolve Coverity NULL_RETURNS 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 --- diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index d7a380e4ad..b5d8edfcb7 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -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) {