Manually kill gzip if restore fails before starting qemu
Manually kill gzip if restore fails before starting qemu

If a guest image is saved in compressed format, and the restore fails
in some way after the intermediate process used to uncompress the
image has been started, but before qemu has been started to hook up to
the uncompressor, libvirt will endlessly wait for the uncompressor to
finish, but it never will because it's still waiting to have something
hooked up to drain its output.

The solution is to close the pipes on both sides of the uncompressor,
then send a SIGTERM before calling waitpid on it (only if the restore
has failed, of course).

emaste/libvirt,jardasgit/libvirt,dumbbell/libvirt,danwent/libvirt-ovs,zippy2/libvirt,danwent/libvirt-ovs,novel/fbsd-libvirt,zhlcindy/libvirt-1.1.4-maintain,taget/libvirt,fabianfreyer/libvirt,wiedi/libvirt,jfehlig/libvirt,warewolf/libvirt,emaste/libvirt,warewolf/libvirt,foomango/libvirt,cbosdo/libvirt,bjzhang/libvirt,datto/libvirt,novel/fbsd-libvirt,wiedi/libvirt,crobinso/libvirt,emaste/libvirt,cbosdo/libvirt,datto/libvirt,rbu/libvirt,dumbbell/libvirt,bjzhang/libvirt,crobinso/libvirt,trainstack/libvirt,siboulet/libvirt-openvz,crobinso/libvirt,nertpinx/libvirt,danwent/libvirt-ovs,siboulet/libvirt-openvz,cbosdo/libvirt,elmarco/libvirt,rmarwaha/libvirt,trainstack/libvirt,usc-isi/libvirt,rlaager/libvirt,iam-TJ/libvirt,zippy2/libvirt,eskultety/libvirt,rbu/libvirt,jardasgit/libvirt,trainstack/libvirt,usc-isi/libvirt,jeckersb/libvirt,rbu/libvirt,rbu/libvirt,kantai/libvirt-vfork,VenkatDatta/libvirt,shugaoye/libvirt,fabianfreyer/libvirt,taget/libvirt,agx/libvirt,andreabolognani/libvirt,dumbbell/libvirt,emaste/libvirt,wiedi/libvirt,taget/libvirt,trainstack/libvirt,shugaoye/libvirt,libvirt/libvirt,bjzhang/libvirt,olafhering/libvirt,novel/fbsd-libvirt,olafhering/libvirt,nertpinx/libvirt,novel/fbsd-libvirt,trainstack/libvirt,foomango/libvirt,foomango/libvirt,eskultety/libvirt,iam-TJ/libvirt,elmarco/libvirt,rmarwaha/libvirt1,VenkatDatta/libvirt,foomango/libvirt,trainstack/libvirt,VenkatDatta/libvirt,rmarwaha/libvirt1,taget/libvirt,rmarwaha/libvirt,warewolf/libvirt,iam-TJ/libvirt,libvirt/libvirt,rmarwaha/libvirt,foomango/libvirt,novel/fbsd-libvirt,wiedi/libvirt,eskultety/libvirt,novel/fbsd-libvirt,cbosdo/libvirt,crobinso/libvirt,agx/libvirt,VenkatDatta/libvirt,rbu/libvirt,novel/fbsd-libvirt,libvirt/libvirt,zhlcindy/libvirt-1.1.4-maintain,danwent/libvirt-ovs,elmarco/libvirt,bjzhang/libvirt,nertpinx/libvirt,shugaoye/libvirt,nertpinx/libvirt,rmarwaha/libvirt,VenkatDatta/libvirt,agx/libvirt,eskultety/libvirt,siboulet/libvirt-openvz,kantai/libvirt-vfork,emaste/libvirt,andreabolognani/libvirt,agx/libvirt,taget/libvirt,jfehlig/libvirt,rlaager/libvirt,soulxu/libvirt-xuhj,jeckersb/libvirt,nertpinx/libvirt,jeckersb/libvirt,rmarwaha/libvirt1,jeckersb/libvirt,eskultety/libvirt,iam-TJ/libvirt,rlaager/libvirt,bjzhang/libvirt,fabianfreyer/libvirt,kantai/libvirt-vfork,jeckersb/libvirt,rlaager/libvirt,olafhering/libvirt,siboulet/libvirt-openvz,agx/libvirt,zhlcindy/libvirt-1.1.4-maintain,jfehlig/libvirt,cbosdo/libvirt,rmarwaha/libvirt1,usc-isi/libvirt,zippy2/libvirt,usc-isi/libvirt,fabianfreyer/libvirt,shugaoye/libvirt,jfehlig/libvirt,elmarco/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,leilihh/libvirt,olafhering/libvirt,dumbbell/libvirt,soulxu/libvirt-xuhj,iam-TJ/libvirt,andreabolognani/libvirt,datto/libvirt,leilihh/libvirt,jardasgit/libvirt,soulxu/libvirt-xuhj,emaste/libvirt,jeckersb/libvirt,datto/libvirt,novel/fbsd-libvirt,zhlcindy/libvirt-1.1.4-maintain,iam-TJ/libvirt,emaste/libvirt,jardasgit/libvirt,wiedi/libvirt,libvirt/libvirt,warewolf/libvirt,leilihh/libvirt,leilihh/libvirt,rmarwaha/libvirt1,siboulet/libvirt-openvz,datto/libvirt,shugaoye/libvirt,warewolf/libvirt,dumbbell/libvirt,wiedi/libvirt,soulxu/libvirt-xuhj,danwent/libvirt-ovs,novel/fbsd-libvirt,kantai/libvirt-vfork,rlaager/libvirt,warewolf/libvirt,soulxu/libvirt-xuhj,zippy2/libvirt,warewolf/libvirt,rmarwaha/libvirt,fabianfreyer/libvirt,leilihh/libvirt,dumbbell/libvirt,elmarco/libvirt,usc-isi/libvirt,rmarwaha/libvirt1,zhlcindy/libvirt-1.1.4-maintain,jardasgit/libvirt,wiedi/libvirt,jeckersb/libvirt,trainstack/libvirt,iam-TJ/libvirt,rmarwaha/libvirt,leilihh/libvirt,kantai/libvirt-vfork