Make domain save work on root-squash NFS
Make domain save work on root-squash NFS

Move *all* file operations related to creation and writing of libvirt
header to the domain save file into a hook function that is called by
virFileOperation. First try to call virFileOperation as root. If that
fails with EACCESS, and (in the case of Linux) statfs says that we're
trying to save the file on an NFS share, rerun virFileOperation,
telling it to fork a child process and setuid to the qemu user. This
is the only way we can successfully create a file on a root-squashed
NFS server.

This patch (along with setting dynamic_ownership=0 in qemu.conf)
makes qemudDomainSave work on root-squashed NFS.

* src/qemu/qemu_driver.c: provide new qemudDomainSaveFileOpHook()
  utility, use it in qemudDomainSave() if normal creation of the
  file as root failed, and after checking the filesystem type for
  the storage is NFS. In that case we also bypass the security
  driver, as this would fail on NFS.

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