libvirt opens kernel+initrd in read-write mode

Is there a reason why libvirtd v6.5.0 opens kernel+initrd in mode RW? 'virsh start vm' fails of both are on a read-only filesystem. Not sure if this ever worked before. <domain type='kvm'> <os> <type arch='x86_64' machine='pc-i440fx-5.1'>hvm</type> <kernel>/path/to/kernel</kernel> <initrd>/path/to/initrd</initrd> <cmdline>net.ifnames=0 console=ttyS0,115200 linemode=1 panic=9 start_shell</cmdline> <boot dev='hd'/> </os> </domain> .... 13111 stat("/path/to/initrd", {st_mode=S_IFREG|0755, st_size=119207064, ...}) = 0 13111 openat(AT_FDCWD, "/path/to/initrd", O_RDWR) = -1 EROFS (Read-only file system) .... Olaf

On 7/9/20 4:32 PM, Olaf Hering wrote:
Is there a reason why libvirtd v6.5.0 opens kernel+initrd in mode RW? 'virsh start vm' fails of both are on a read-only filesystem. Not sure if this ever worked before.
<domain type='kvm'> <os> <type arch='x86_64' machine='pc-i440fx-5.1'>hvm</type> <kernel>/path/to/kernel</kernel> <initrd>/path/to/initrd</initrd> <cmdline>net.ifnames=0 console=ttyS0,115200 linemode=1 panic=9 start_shell</cmdline> <boot dev='hd'/> </os> </domain>
.... 13111 stat("/path/to/initrd", {st_mode=S_IFREG|0755, st_size=119207064, ...}) = 0 13111 openat(AT_FDCWD, "/path/to/initrd", O_RDWR) = -1 EROFS (Read-only file system) ....
Hey, do you see an actual libvirt error? I think this may come from secdrivers trying to remember the original owner of kernel/initrd files. If you set remember_owner=0 in /etc/libvirt/qemu.conf (and restart libvirtd) then does it fix your problem? Michal

Am Thu, 9 Jul 2020 19:00:18 +0200 schrieb Michal Privoznik <mprivozn@redhat.com>:
do you see an actual libvirt error? I think this may come from secdrivers trying to remember the original owner of kernel/initrd files.
Jul 09 16:10:42 libvirtd[5741]: internal error: child reported (status=125): unable to open /path/to/initrd: Read-only file system Jul 09 16:10:42 libvirtd[5741]: unable to open /path/to/initrd: Read-only file system Jul 09 16:10:42 libvirtd[5741]: internal error: child reported (status=125): unable to open /path/to/initrd: Read-only file system Jul 09 16:10:42 libvirtd[5741]: unable to open /path/to/initrd: Read-only file system
If you set remember_owner=0 in /etc/libvirt/qemu.conf (and restart libvirtd) then does it fix your problem?
Yes, this helps as a workaround. Olaf

On 7/9/20 8:27 PM, Olaf Hering wrote:
Am Thu, 9 Jul 2020 19:00:18 +0200 schrieb Michal Privoznik <mprivozn@redhat.com>:
do you see an actual libvirt error? I think this may come from secdrivers trying to remember the original owner of kernel/initrd files.
Jul 09 16:10:42 libvirtd[5741]: internal error: child reported (status=125): unable to open /path/to/initrd: Read-only file system Jul 09 16:10:42 libvirtd[5741]: unable to open /path/to/initrd: Read-only file system Jul 09 16:10:42 libvirtd[5741]: internal error: child reported (status=125): unable to open /path/to/initrd: Read-only file system Jul 09 16:10:42 libvirtd[5741]: unable to open /path/to/initrd: Read-only file system
If you set remember_owner=0 in /etc/libvirt/qemu.conf (and restart libvirtd) then does it fix your problem?
Yes, this helps as a workaround.
Patch proposed here: https://www.redhat.com/archives/libvir-list/2020-July/msg00530.html Michal
participants (2)
-
Michal Privoznik
-
Olaf Hering