+++ This bug was initially created as a clone of Bug #1942275 +++
Description of problem:
Can not restore guest from a block device
Version-Release number of selected component (if applicable):
libvirt-6.0.0-35.module+el8.4.0+10230+7a9b21e4.x86_64
qemu-kvm-4.2.0-48.module+el8.4.0+10368+630e803b.x86_64
selinux-policy-3.14.3-67.el8.noarch
How reproducible:
100%
Steps to Reproduce:
1. prepare a block device
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 223G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 222G 0 part
├─rhel_dell--per6415--04-root 253:0 0 70G 0 lvm /
├─rhel_dell--per6415--04-swap 253:1 0 11.7G 0 lvm [SWAP]
└─rhel_dell--per6415--04-home 253:2 0 140.3G 0 lvm /home
sdb 8:16 0 20G 0 disk
2. check selinux mode
# getenforce
Enforcing
3. save the guest to the block device
# virsh save avocado-vt-vm1 /dev/sdb
Domain avocado-vt-vm1 saved to /dev/sdb
4. check the context of sdb
# ll -aZ /dev/sdb
brw-rw----. 1 root root system_u:object_r:svirt_image_t:s0:c713,c725 8, 16 Mar 23 22:29 /dev/sdb
5. restore the guest from the block device
# virsh restore /dev/sdb
error: Failed to restore domain from /dev/sdb
error: internal error: child reported (status=125): unable to set security context 'system_u:object_r:virt_content_t:s0' on '/dev/sdb': No such file or directory
Expected results:
guest can be restored
Additional info:
when put put namespaces = [] in qemu.conf, it works well.
The same with Bug #1772838, difference is just the error msg.
--- Additional comment from Peter Krempa on 2021-03-24 08:06:04 UTC ---
It seems that the issue was already fixed upstream. Targetting to rhel-8.6 which will be rebased.
--- Additional comment from Michal Privoznik on 2021-03-24 08:40:29 UTC ---
Right, I think this was fixed upstream as:
https://gitlab.com/libvirt/libvirt/-/commit/824e349397b1f1fa5d7c1c5d21c88e04df21bf17
which aimed to fix bug 1851016.