qemu_agent: Ignore expected EOFs
qemu_agent: Ignore expected EOFs

https://bugzilla.redhat.com/show_bug.cgi?id=892079

One of my previous patches (f2a4e5f176c408) tried to fix crashing
libvirtd on domain detroy. However, we need to copy pattern from
qemuProcessHandleMonitorEOF() instead of decrementing reference
counter. The rationale for this is, if qemu process is dying due
to domain being destroyed, we obtain EOF on both the monitor and
agent sockets. However, if the exit is expected, qemuProcessStop
is called, which cleans both agent and monitor sockets up. We
want qemuAgentClose() to be called iff the EOF is not expected,
so we don't leak an FD and memory. Moreover, there could be race
with qemuProcessHandleMonitorEOF() which could have already
closed the agent socket, in which case we don't want to do
anything.

datto/libvirt,siboulet/libvirt-openvz,zhlcindy/libvirt-1.1.4-maintain,rlaager/libvirt,jfehlig/libvirt,olafhering/libvirt,siboulet/libvirt-openvz,fabianfreyer/libvirt,libvirt/libvirt,jardasgit/libvirt,rlaager/libvirt,crobinso/libvirt,rlaager/libvirt,zippy2/libvirt,siboulet/libvirt-openvz,zhlcindy/libvirt-1.1.4-maintain,cbosdo/libvirt,libvirt/libvirt,zhlcindy/libvirt-1.1.4-maintain,andreabolognani/libvirt,eskultety/libvirt,iam-TJ/libvirt,agx/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,trainstack/libvirt,iam-TJ/libvirt,shugaoye/libvirt,taget/libvirt,cbosdo/libvirt,VenkatDatta/libvirt,crobinso/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,eskultety/libvirt,shugaoye/libvirt,taget/libvirt,trainstack/libvirt,libvirt/libvirt,olafhering/libvirt,elmarco/libvirt,agx/libvirt,nertpinx/libvirt,rlaager/libvirt,shugaoye/libvirt,taget/libvirt,trainstack/libvirt,shugaoye/libvirt,agx/libvirt,trainstack/libvirt,iam-TJ/libvirt,zhlcindy/libvirt-1.1.4-maintain,nertpinx/libvirt,jfehlig/libvirt,agx/libvirt,fabianfreyer/libvirt,VenkatDatta/libvirt,siboulet/libvirt-openvz,zippy2/libvirt,eskultety/libvirt,taget/libvirt,shugaoye/libvirt,rlaager/libvirt,datto/libvirt,zippy2/libvirt,siboulet/libvirt-openvz,VenkatDatta/libvirt,nertpinx/libvirt,jardasgit/libvirt,trainstack/libvirt,libvirt/libvirt,cbosdo/libvirt,eskultety/libvirt,elmarco/libvirt,agx/libvirt,cbosdo/libvirt,trainstack/libvirt,eskultety/libvirt,iam-TJ/libvirt,iam-TJ/libvirt,VenkatDatta/libvirt,jfehlig/libvirt,nertpinx/libvirt,crobinso/libvirt,VenkatDatta/libvirt,crobinso/libvirt,jardasgit/libvirt,zhlcindy/libvirt-1.1.4-maintain,andreabolognani/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,elmarco/libvirt,cbosdo/libvirt,iam-TJ/libvirt,datto/libvirt,taget/libvirt,andreabolognani/libvirt,olafhering/libvirt,iam-TJ/libvirt,olafhering/libvirt,nertpinx/libvirt,andreabolognani/libvirt,datto/libvirt,elmarco/libvirt,zippy2/libvirt,trainstack/libvirt,datto/libvirt,elmarco/libvirt