Created attachment 1670981 [details] The libvirtd log Description of problem: As subject Version-Release number of selected component (if applicable): qemu-kvm-4.2.0-15.module+el8.2.0+6029+618ef2ec.x86_64 libvirt-6.0.0-10.virtcov.el8.x86_64, libvirt upstream 008abeb03c How reproducible: 100% Steps to Reproduce: 1. Trigger https://bugzilla.redhat.com/show_bug.cgi?id=1812399 2. Start VM and attach the disk again: ➜ virsh attach-device pc disk.xml error: Failed to attach device from disk.xml error: internal error: child reported (status=125): Requested operation is not valid: Setting different SELinux label on /tmp/disk-raw which is already in use Actual results: As subject Expected results: Disk attached Additional info: A related error happens when qemu crashes: 2020-03-17 09:22:52.405+0000: 396769: error : virProcessRunInFork:1200 : internal error: child reported (status=125): Kernel does not provide mount namespace: No such file or directory
Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2020-March/msg00652.html
I've just pushed patches upstream: ea903036fa security: Try harder to run transactions c799d150d5 virprocess: Passthru error from virProcessRunInForkHelper ed8c503ae8 virfile: Handle directories in virFileBindMountDevice() 140036237e qemuDomainBuildNamespace: Make @devPath const ca2edd678d qemuDomainBuildNamespace: Try harder to remove temp directories 6bc746d66d qemuDomainCreateDeviceRecursive: Report error if mkdir() fails
Test pass on libirt v6.3.0-107-gc0e04c2e62 qemu-kvm-5.0.0-0.module+el8.3.0+6620+5d5e1420.x86_64
Verified at libvirt version: libvirt-6.3.0-1.module+el8.3.0+6478+69f490bb.x86_64 qemu-kvm-5.0.0-0.module+el8.3.0+6620+5d5e1420.x86_64 Step: 1.Live attach/detach the disk in loop with disk xml: <disk type="file" device="disk"> <driver name="qemu" type="raw" cache="none" discard="ignore" io="native"/> <source file="/tmp/disk-raw"> </source> <backingStore/> <target dev="sdb" bus="scsi"/> </disk> 2.Live attach/detach the disk in loop: # while true;do virsh attach-device test1 attach.xml; virsh detach-device test1 attach.xml;done Device attached successfully Device detached successfully Device attached successfully Device detached successfully ...... error: Failed to attach device from attach.xml error: Unable to read from monitor: Connection reset by peer error: Failed to detach device from attach.xml error: Requested operation is not valid: domain is not running Vm crashed as expected. 3.Then attach and detach again: # virsh attach-device test1 attach.xml Device attached successfully # virsh detach-device test1 attach.xml Device detached successfully No error occured,work as expected only for this bug. So verified.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:5137