event: don't queue NULL event on OOM
event: don't queue NULL event on OOM

Ever since commit 61ac8ce, Coverity complained about
remoteNetworkBuildEventLifecycle not checking for NULL failure
to build an event, compared to other calls in the code base.
But the problem is latent from copy and paste; all 17 of our
remote*BuildEvent* functions in remote_driver.c have the same
issue - if an OOM causes an event to not be built, we happily
pass NULL to remoteEventQueue(), but that function has marked
event as a nonnull parameter.  We were getting lucky (the
event queue's first use of the event happened to be a call to
virIsObjectClass(), which acts gracefully on NULL, so there
was no way to crash); but this is a latent bug waiting to bite
us due to the disregard for the nonnull attribute, as well as
a waste of resources in the event queue.  Better is to just
refuse to queue NULL.  The discard is silent, since the problem
only happens on OOM, and since events are already best effort -
if we fail to get an event, it's not like we have any memory
left to report the issue, nor any idea of who would benefit
from knowing we couldn't create or queue the event.

* src/remote/remote_driver.c (remoteEventQueue): Ignore NULL event.

Signed-off-by: Eric Blake <a9da18479c871fe903d9590822cfe2629c6a4d11@redhat.com>

andreabolognani/libvirt,jardasgit/libvirt,datto/libvirt,eskultety/libvirt,shugaoye/libvirt,jfehlig/libvirt,shugaoye/libvirt,taget/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,taget/libvirt,datto/libvirt,VenkatDatta/libvirt,datto/libvirt,shugaoye/libvirt,rlaager/libvirt,agx/libvirt,VenkatDatta/libvirt,nertpinx/libvirt,jardasgit/libvirt,agx/libvirt,jardasgit/libvirt,nertpinx/libvirt,eskultety/libvirt,crobinso/libvirt,datto/libvirt,datto/libvirt,shugaoye/libvirt,andreabolognani/libvirt,agx/libvirt,elmarco/libvirt,taget/libvirt,fabianfreyer/libvirt,shugaoye/libvirt,jfehlig/libvirt,crobinso/libvirt,rlaager/libvirt,jardasgit/libvirt,elmarco/libvirt,agx/libvirt,eskultety/libvirt,taget/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,zippy2/libvirt,olafhering/libvirt,libvirt/libvirt,nertpinx/libvirt,jfehlig/libvirt,zippy2/libvirt,taget/libvirt,agx/libvirt,andreabolognani/libvirt,fabianfreyer/libvirt,elmarco/libvirt,eskultety/libvirt,VenkatDatta/libvirt,olafhering/libvirt,nertpinx/libvirt,olafhering/libvirt,zippy2/libvirt,olafhering/libvirt,andreabolognani/libvirt,crobinso/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,libvirt/libvirt,rlaager/libvirt,VenkatDatta/libvirt,rlaager/libvirt,libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,zippy2/libvirt,eskultety/libvirt,libvirt/libvirt,rlaager/libvirt,elmarco/libvirt,jfehlig/libvirt,elmarco/libvirt