Bug 1783255 - <nvram> auto-creation does not honour permissions defined in libvirtd.conf
Summary: <nvram> auto-creation does not honour permissions defined in libvirtd.conf
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: khanicov
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-13 12:58 UTC by Mark Zealey
Modified: 2021-06-17 10:47 UTC (History)
4 users (show)

Fixed In Version: libvirt-7.4.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-17 10:47:00 UTC
Embargoed:


Attachments (Terms of Use)

Description Mark Zealey 2019-12-13 12:58:43 UTC
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


Actual results:

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


Expected results:

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.

Additional info:

Setting dynamic_ownership = 1 fixes this but messes up other permissions in other parts of the system.

Comment 1 khanicov 2021-05-21 11:43:16 UTC
Patches proposed on the list:
https://listman.redhat.com/archives/libvir-list/2021-May/msg00647.html

Comment 2 khanicov 2021-05-21 16:20:02 UTC
Merged upstream as:

gbcdaa91a27 qemu: Use qemuDomainOpenFile() in qemuPrepareNVRAM()

v7.3.0-252-gbcdaa91a27


Note You need to log in before you can comment on or make changes to this bug.