snapshot: don't leak resources on qemu snapshot failure
snapshot: don't leak resources on qemu snapshot failure

https://bugzilla.redhat.com/show_bug.cgi?id=727709
mentions that if qemu fails to create the snapshot (such as what
happens on Fedora 15 qemu, which has qmp but where savevm is only
in hmp, and where libvirt is old enough to not try the hmp fallback),
then 'virsh snapshot-list dom' will show a garbage snapshot entry,
and the libvirt internal directory for storing snapshot metadata
will have a bogus file.

This fixes the fallout bug of polluting the snapshot-list with
garbage on failure (the root cause of the F15 bug of not having
fallback to hmp has already been fixed in newer libvirt releases).

* src/qemu/qemu_driver.c (qemuDomainSnapshotCreateXML): Allocate
memory before making snapshot, and cleanup on failure.  Don't
dereference NULL if transient domain exited during snapshot creation.

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