Bug 1329174

Summary: Can't remove a rng device when the guest is running sometimes
Product: Red Hat Enterprise Linux 7 Reporter: XiaoyunHu <xiahu>
Component: qemu-kvm-rhevAssignee: pagupta
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: hhuang, juzhou, mxie, mzhan, pagupta, rbalakri, tzheng, virt-maint, xiahu, xiaodwan, yafu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-03 06:34:58 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:

Description XiaoyunHu 2016-04-21 10:27:36 UTC
Description of problem:
Can't remove a rng device when the guest is running sometimes.

Version-Release number of selected component (if applicable):
virt-manager-1.3.2-1.el7.noarch
libvirt-1.3.3-2.el7.x86_64


How reproducible:
50%

Steps to Reproduce:
1. Prepare a shut off guest without rng device.
2. Running the guest and prepare a rng xml.
# cat rng.xml
<rng model="virtio">
  <backend model="random">/dev/random</backend>
</rng>
3.Run "virsh attach-device $guest rng.xml" to attach the rng device to the $guest in Host.
# virsh attach-device $guest rng.xml
Device attached successfully

There will be a rng device in the guest's hardware details.
4.Run "ls /dev|grep hwrng" in the guest.
# ls /dev|grep hwrng
hwrng
5. Run "virsh detach-device $guest rng.xml" to detach the rng device from the $guest in Host.
# virsh detach-device $guest rng.xml
Device detached successfully
6. Run "virsh dumpxml $guest|grep -A4 rng" in Host and check if there is the rng device in hardware details of the guest.


Actual results:
After Step6:
1.#virsh dumpxml $guest|grep -A4 rng
    <rng model='virtio'>
      <backend model='random'>/dev/random</backend>
      <alias name='rng0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/>
    </rng>
2.There is still a rng device in hardware details of the guest .

Expected results:
1.#virsh dumpxml $guest|grep -A4 rng

2.The rng device in hardware details of the guest is gone.

Additional info:
Please try step 3-6 several times if the bug don't reproduce.

Comment 2 Peter Krempa 2016-04-21 10:51:04 UTC
Looks like an issue with the RNG device itself since libvirt correctly removes it sometimes. PCI devices require guest cooperation with the guest to eject.

Please provide version of qemu and the guest OS that was used.

Moving to qemu for further investigation.

Comment 3 XiaoyunHu 2016-04-21 11:23:24 UTC
(In reply to Peter Krempa from comment #2)
> Looks like an issue with the RNG device itself since libvirt correctly
> removes it sometimes. PCI devices require guest cooperation with the guest
> to eject.
> 
> Please provide version of qemu and the guest OS that was used.
> 
> Moving to qemu for further investigation.

Host: qemu-kvm-rhev-2.3.0-31.el7_2.12.x86_64

Guest: kernel-3.10.0-327.el7.x86_64
Red Hat Enterprise Linux Server release 7.2

Thanks.

Comment 4 Amit Shah 2016-08-03 06:34:58 UTC

*** This bug has been marked as a duplicate of bug 1348044 ***