Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

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:
Embargoed:

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 ***