storage: fix device detach regression with cgroup ACLs
storage: fix device detach regression with cgroup ACLs

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

Commit 38c4a9cc introduced a regression in hot unplugging of disks
from qemu, where cgroup device ACLs were no longer being revoked
(thankfully not a security hole: cgroup ACLs only prevent open()
of the disk; so reverting the ACL prevents future abuse but doesn't
stop abuse from an fd that was already opened before the ACL change).

The actual regression is due to a latent bug.  The hot unplug code
was computing the set of files needing cgroup ACL revocation based
on the XML passed in by the user, rather than based on the domain's
details on which disk was being deleted.  As long as the revoke
path was always recomputing the backing chain, this didn't really
matter; but now that we want to compute the chain exactly once and
remember that computation, we need to hang on to the backing chain
until after the revoke has happened.

* src/qemu/qemu_hotplug.c (qemuDomainDetachPciDiskDevice):
Transfer backing chain before deletion.

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