Description of problem: <nvram> auto-creation does not honour permissions defined in libvirtd.conf
Version-Release number of selected component (if applicable): libvirt-4.5.0-23.el7_7.1.x86_64
How reproducible: Always
Steps to Reproduce:
1. Set libvirtd.conf to have user = XXX and group = XXX where XXX is non-root and qemu.conf to have dynamic_ownership = 0
2. virsh create a domain with <nvram> component which instantiates from a template
It has created the file but given it root permissions.
error: Failed to create domain from XML
error: internal error: qemu unexpectedly closed the monitor: 2019-12-13T14:52:42.059479Z qemu-kvm: -drive file=.../OVMF_VARS.fd,if=pflash,format=raw,unit=1: Could not open '.../OVMF_VARS.fd': Permission denied
The template file should be correctly instantiated owned by the user/group specified in libvirtd.conf rather than root.root. This is the case of eg block operations while running so no idea why it's not being applied to nvram created from a template.
Setting dynamic_ownership = 1 fixes this but messes up other permissions in other parts of the system.