diff options
author | John Ferlan <jferlan@redhat.com> | 2014-08-28 14:56:33 -0400 |
---|---|---|
committer | John Ferlan <jferlan@redhat.com> | 2014-08-28 14:59:56 -0400 |
commit | 0322643ed57a7ed2f301af9b429f7183f5c4b9c6 (patch) | |
tree | a911a926ee8180b40fadb0bd4b429c3b45817573 | |
parent | d1bde8eda3b4027b38c7c1d5942a6388b0458803 (diff) | |
download | libvirt-0322643ed57a7ed2f301af9b429f7183f5c4b9c6.tar.gz |
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 <jferlan@redhat.com>
-rw-r--r-- | src/libxl/libxl_migration.c | 5 |
1 files changed, 5 insertions, 0 deletions
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) { |