Bug 1449510
Summary: | libvirt will remove the host file after detach some device or attach failed when enable namespace | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Luyao Huang <lhuang> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED ERRATA | QA Contact: | yafu <yafu> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.4 | CC: | dyuan, rbalakri, xuzhang, yafu |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-3.2.0-5.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2017-08-02 00:08:25 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Luyao Huang
2017-05-10 07:59:25 UTC
(In reply to yafu from comment #4) > Reproduced with libvirt-3.2.0-4.el7.x86_64, test steps are as comment 0. > > Verified pass with libvirt-3.2.0-10.virtcov.el7.x86_64. You should verify with regular builds and not virtcov ;-) But there's no difference in the code between the two, so you'll find the same result when trying the official build. (In reply to Michal Privoznik from comment #5) > (In reply to yafu from comment #4) > > Reproduced with libvirt-3.2.0-4.el7.x86_64, test steps are as comment 0. > > > > Verified pass with libvirt-3.2.0-10.virtcov.el7.x86_64. > > You should verify with regular builds and not virtcov ;-) But there's no > difference in the code between the two, so you'll find the same result when > trying the official build. You are right. I will update the comments. Thanks for your reminding.:) Reproduced with libvirt-3.2.0-4.el7.x86_64, test steps are as comment 0. Verified pass with libvirt-3.2.0-10.el7.x86_64. Scenario1:Test the host file will not remove by libvirt after attached failed 1.Start a guest: #virsh start full-73 2.Prepare a resource not in dev dir: # touch /tmp/testfile # cat rng.xml <rng model='virtio'> <backend model='random'>/tmp/testfile</backend> </rng> 4.Attach the rng device to the guest: # virsh attach-device full-73 rng.xml error: Failed to attach device from rng.xml error: internal error: unable to execute QEMU command 'object-add': Could not open '/tmp/testfile': Permission denied 5.The file still exists after attach failed: # ll /tmp/testfile -rw-r--r--. 1 root root 0 Jun 15 12:50 /tmp/testfile 6.Also test attach chardev,nvdimm device failed, the source file will not delete by libvirt; Scenario 2:Test the file will not delete by libvirt after detach: 1.Start a guest with 2 disks: #virsh domblklist full-73 Target Source ------------------------------------------------ vda /nfs-images/yafu/rhel7.2.qcow2 vdd /var/lib/libvirt/images/generic.qcow2 2.Detach vdd from guest: #cat disk.xml <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/generic.qcow2'/> <target dev='vdd' bus='virtio'/> </disk> #virsh detach-device full-73 disk.xml Device detached successfully 3.Check the source file of vdd: # ll /var/lib/libvirt/images/generic.qcow2 -rw-------. 1 root root 21478375424 Jun 9 11:31 /var/lib/libvirt/images/generic.qcow2 Scenario 3:Attach/detach device with source file created in the preserved mount dir 1.Install vhostmd package and start the daemon: #yum -y install vhostmd #systemctl start vhostmd 2.Attach a vhostmd disk(Source file is created by vhostmd daemon in the /dev/shm/vhostmd0) #cat vhostmd.disk <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/dev/shm/vhostmd0'/> <target dev='vdb' bus='virtio'/> </disk> #virsh attach-device full-73 vhostmd.disk Device attached successfully 3.Check the vhostmd is attached successfully: #virsh domblklist full-73 Target Source ------------------------------------------------ vda /nfs-images/yafu/rhel7.2.qcow2 vdb /dev/shm/vhostmd0 4.Detach the vhostmd disk: # virsh detach-device full-73 disk-vhostmd.xml Device detached successfully 5.Check the vhostmd disk is detached successfully: [root@localhost xml]# virsh domblklist full-73 Target Source ------------------------------------------------ vda /nfs-images/yafu/rhel7.2.qcow2 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, 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/RHEA-2017:1846 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, 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/RHEA-2017:1846 |