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 1131417

Summary: [virtio-win][viorng][rhel6]virtio rng device doesn't work after repeatly hot-unplug/hotplug while open driver verifier with all the flags enabled
Product: Red Hat Enterprise Linux 7 Reporter: lijin <lijin>
Component: virtio-winAssignee: Gal Hammer <ghammer>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: acathrow, bcao, hhuang, lijin, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-04 13:47:22 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 lijin 2014-08-19 08:43:26 UTC
Created attachment 928235 [details]
win8.1-32 device manager screenshot

Description of problem:
hot-unplug/hotplug rng device in a loop in win8.1-32 guest,rng device doesn't work after the loop end.There is a yellow exclamation mark on device manager(as shown in the attachment),no random number can be generated when run random.exe in guest.

Version-Release number of selected component (if applicable):
kernel-2.6.32-492.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.438.el6.x86_64
seabios-0.6.1.2-28.el6.x86_64
virtio-win-prewhql-88

How reproducible:
100%

Steps to Reproduce:
1.boot guest with:
/usr/libexec/qemu-kvm -drive file=win8.1-32.raw,if=none,cache=none,media=disk,format=raw,id=drive-ide0-0-1 -device ide-drive,drive=drive-ide0-0-1,bus=ide.0 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -monitor stdio -usb -device usb-tablet,id=tablet1 -boot menu=on -chardev file,path=/root/console.log,id=serial1 -device isa-serial,chardev=serial1,id=s1 -cpu Penryn,+sep -smp 2,cores=2,threads=1,sockets=1 -m 2G -enable-kvm -drive file=virtio-win-prewhql-0.1-88.iso,if=none,cache=none,media=cdrom,format=raw,id=drive-ide0-0-0 -device ide-drive,id=ide0-0-0,drive=drive-ide0-0-0,bus=ide.1 -drive file=virtio-win-prewhql-0.1-88.vfd,if=none,id=drive-fdc0-0-0,format=raw,cache=none -global isa-fdc.driveA=drive-fdc0-0-0 -qmp tcp:0:4445,server,nowait -vnc :1 -vga cirrus \
-object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0,id=rng-device0,id=rng-device0
2.set the verifier with all the flags enabled,then reboot guest to make it effective:
cmd:verifier /flags 0x01FFFFFF /driver viorng.sys
3.Hot-plug/unplug rng device in a loop
#!/bin/bash
# some simply scripts for balloon device hotplug/unplug in a loop
let i=0
exec 3<>/dev/tcp/localhost/4445  #note modify this to qmp port
echo -e "{ 'execute': 'qmp_capabilities' }" >&3
read response <&3
echo $response
while [ $i -lt 500 ]
do
    echo -e "{ 'execute': 'device_del', 'arguments': {'id': 'rng-device0' }}">&3 ;
    sleep 2 ;
    read response <&3 ;
    echo "$i: $response"
    sleep 2 ;
     echo -e "{'execute':'device_add','arguments':{'driver':'virtio-rng-pci','id':'rng-device0','addr':'0x9'}}">&3 ;
    sleep 2 ;
    read response <&3
    echo "$i: $response"
    let i=$i+1
done

Actual results:
1.after hotplug/unplug about 60~80 times ,there is a yellow exclamation mark on device manager(as shown in the attachment);
2.no random number can be generated when run random.exe in guest;

Expected results:
rng device can function well after the hotplug loop ends 

Additional info:
set verifier with the standard settings cannot hit this issue:
cmd:verifier /standard /driver viorng.sys

Comment 2 lijin 2014-08-20 03:03:04 UTC
win2k8r2 guest hit this issue sometimes,not 100%

Comment 3 Gal Hammer 2014-09-04 11:25:11 UTC
I see and reproduce the behavior as describe in the bug description. I also see that the yellow exclamation mark appearance is not persistence, it disappears after few more hot-plugging.

Does it also happen on your setup too?

Comment 4 lijin 2014-09-04 13:01:54 UTC
(In reply to Gal Hammer from comment #3)
> I see and reproduce the behavior as describe in the bug description. I also
> see that the yellow exclamation mark appearance is not persistence, it
> disappears after few more hot-plugging.
> 
> Does it also happen on your setup too?

yes,this also happen during my test,sometimes the yellow exclamation mark disappeared during the loop;but in the end,it still existed when the loop ends.

Comment 5 Gal Hammer 2014-09-04 13:47:22 UTC
(In reply to lijin from comment #4)
> (In reply to Gal Hammer from comment #3)
> > I see and reproduce the behavior as describe in the bug description. I also
> > see that the yellow exclamation mark appearance is not persistence, it
> > disappears after few more hot-plugging.
> > 
> > Does it also happen on your setup too?
> 
> yes,this also happen during my test,sometimes the yellow exclamation mark
> disappeared during the loop;but in the end,it still existed when the loop
> ends.

The verifier with all the flags set add tests for low memory conditions (check if the driver can handle memory allocation's failures). In this hot-plugging scenario the driver fail to load (hence the yellow exclamation mark) because it failed to allocate a continuous memory for the virt queue. There is nothing else it can do.

This is the expected behavior and not a bug.