• E
    storage: use cache to walk backing chain · 38c4a9cc
    Eric Blake 提交于
    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.
    38c4a9cc
virt-aa-helper.c 36.8 KB