Comment 0 for bug 1927519

Revision history for this message
Ioanna Alifieraki (joalif) wrote :

[Impact]

Some times libvirt fails to start a vm with the following error :
libvirt: error : unable to set AppArmor profile 'libvirt-b05b297f-952f-42d6-b04e-f9a13767db54' for '/usr/bin/kvm-spice': No such file or directory

This happens because for some reason file /etc/apparmor.d/libvirt/libvirt-<vm-uuid> has 0 size.

Although, we do not now why the above file gets truncated and therefore we do not know the root cause, I open this bug to come up with a way to mitigate the issue.
E.g. when libvirt sees that this file is 0-size to delete it and create it again.

[Test case]

To reproduce this behaviour, create a vm and stop it, note the uuid.
Then :

## touch /etc/apparmor.d/libvirt/libvirt-<vm-uuid>
# touch /etc/apparmor.d/libvirt/libvirt-b05b297f-952f-42d6-b04e-f9a13767db54
# ls -la libvirt-b05b297f-952f-42d6-b04e-f9a13767db54
-rw-r--r-- 1 root root 0 May 6 18:46 libvirt-b05b297f-952f-42d6-b04e-f9a13767db54

Try to start the vm, it will fail with :
libvirt: error : unable to set AppArmor profile 'libvirt-b05b297f-952f-42d6-b04e-f9a13767db54' for '/usr/bin/kvm-spice': No such file or directory

To be able to start the vm again just delete the libvirt-<vm-uuid> file.

[Regression Potential]

TBD

[Other]

Similar reported bug : https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890084