Move load of AppArmor profile to GenLabel()
Move load of AppArmor profile to GenLabel()

Commit 12317957ecd6c37a2fb16275dcdeeacfe25c517 introduced an incompatible
architectural change for the AppArmor security driver. Specifically,
virSecurityManagerSetAllLabel() is now called much later in
src/qemu/qemu_process.c:qemuProcessStart(). Previously, SetAllLabel() was
called immediately after GenLabel() such that after the dynamic label (profile
name) was generated, SetAllLabel() would be called to create and load the
AppArmor profile into the kernel before qemuProcessHook() was executed. With
12317957ecd6c37a2fb16275dcdeeacfe25c517, qemuProcessHook() is now called
before SetAllLabel(), such that aa_change_profile() ends up being called
before the AppArmor profile is loaded into the kernel (via ProcessLabel() in
qemuProcessHook()).

This patch addresses the change by making GenLabel() load the AppArmor
profile into the kernel after the label (profile name) is generated.
SetAllLabel() is then adjusted to only reload_profile() and append stdin_fn to
the profile when it is specified. This also makes the AppArmor driver work
like its SELinux counterpart with regard to SetAllLabel() and stdin_fn.
Bug-Ubuntu: https://launchpad.net/bugs/801569

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