]> xenbits.xensource.com Git - libvirt.git/commit
storage: use cache to walk backing chain
authorEric Blake <eblake@redhat.com>
Tue, 9 Oct 2012 22:08:14 +0000 (16:08 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 19 Oct 2012 23:35:11 +0000 (17:35 -0600)
commit38c4a9cc40476bd2e598a1876b1254e88a09c760
treee3e74dcfd34752487e15c7ef04eb6c630ef673fd
parent4d34c92947e8cf9e9bedfa227ada1d2dba92d68a
storage: use cache to walk backing chain

We used to walk the backing file chain at least twice per disk,
once to set up cgroup device whitelisting, and once to set up
security labeling.  Rather than walk the chain every iteration,
which possibly includes calls to fork() in order to open root-squashed
NFS files, we can exploit the cache of the previous patch.

* src/conf/domain_conf.h (virDomainDiskDefForeachPath): Alter
signature.
* src/conf/domain_conf.c (virDomainDiskDefForeachPath): Require caller
to supply backing chain via disk, if recursion is desired.
* src/security/security_dac.c
(virSecurityDACSetSecurityImageLabel): Adjust caller.
* src/security/security_selinux.c
(virSecuritySELinuxSetSecurityImageLabel): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupDiskCgroup)
(qemuTeardownDiskCgroup): Likewise.
(qemuSetupCgroup): Pre-populate chain.
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_cgroup.c
src/security/security_dac.c
src/security/security_selinux.c
src/security/virt-aa-helper.c