Bug 1007664
| Summary: | real rng device(QNG PQ4000KU) can not work properly in guest | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Xu Han <xuhan> | ||||
| Component: | qemu-kvm | Assignee: | Amos Kong <akong> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | urgent | ||||||
| Version: | 7.0 | CC: | acathrow, ailan, akong, amit.shah, herrold, juzhang, mazhang, michen, virt-maint, xfu | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | |||||||
| : | 1008263 (view as bug list) | Environment: | |||||
| Last Closed: | 2013-09-13 09:41:41 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: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 1008263 | ||||||
| Attachments: |
|
||||||
|
Description
Xu Han
2013-09-13 05:03:06 UTC
As discussed on irc, even 'cat /dev/ttyUSB1' on the host doesn't give any output, so it's something that's lacking on this particular rng model, rather than on qemu. For this model of rng, a program will have to be written that reads from the rng's interface and pushes that data somewhere. This 'somewhere' can be a socket, for qemu to pick up the data, or to the kernel, to feed into the kernel's entropy pool. For testing, both methods should be available, and we'll use this bug to track the writing of a program that reads from the rng and writes to a socket. The best solution, of course, is to feed to the kernel's entropy pool, so that the qemu default of sending the host's /dev/random data to the guest doesn't have to change, and remains the most secure option. I don't agree this should be a TestBlocker - the real test should be whether the guest receives data from the host. The source of the data should not matter so much to hold up testing / builds. We can use example programs to read random data from device, what we need to do is writing a program to read data by API, then write the data to a socket. ./read-data // create socket1, listen 1024 port of 10.66.4.212 // launch qemu, it will connect the socket1 // accept the connection // read random data and send to remote ./x86_64-softmmu/qemu-system-x86_64 -vnc :0 -snapshot /images/RHEL-Server-6.4-64-virtio.qcow2 -monitor stdio --enable-kvm -m 2000 -chardev socket,host=10.66.4.212,port=1024,id=chr0 -object rng-egd,chardev=chr0,id=rng0 -device virtio-rng-pci,rng=rng0 Created attachment 797225 [details]
Read random data from rng device by libqwqng API (data will be sent to remote socket)
(RandBytes.cpp should be added to libqwqng-1.3.5/examples/ to compile)
localhost) # ./randbytes
remote-host)# ./x86_64-softmmu/qemu-system-x86_64 -vnc :0 -snapshot /images/RHEL-Server-6.4-64-virtio.qcow2 -monitor stdio --enable-kvm -m 2000 -chardev socket,host=10.66.4.212,port=1024,id=chr0 -object rng-egd,chardev=chr0,id=rng0 -device virtio-rng-pci,rng=rng0
guest) # dd if=/dev/hwrng of=/dev/stdout
tested: works well
|