Bug 917886
Summary: | reading hwrng device in guest, can not fetch the data from host | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | yunpingzheng <yunzheng> |
Component: | qemu-kvm | Assignee: | Amit Shah <amit.shah> |
Status: | CLOSED NOTABUG | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | high | Docs Contact: | |
Priority: | medium | ||
Version: | 7.0 | CC: | acathrow, juzhang, michen, qzhang, 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: | 2013-04-17 11:02:45 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: | 917953 |
Description
yunpingzheng
2013-03-05 02:45:44 UTC
Instead of using 'cat' on the guest, use something like the following: python import os f = os.open('/dev/hwrng', os.O_RDONLY) os.read(f, 1) and then you can read more bytes, like os.read(f, 10) or even in a loop: while 1: os.read(f, 10) If the read returns with data, that means things are working fine. Relying on 'cat' means displayable characters are returned by the host all the time, which may not be true. hi Amit using python read it works. you mean the characters are always not displayable ? os.open("/dev/hwrng", os.O_RDONLY) 4 >>> os.read(4, 10) 'h\xca\x8b\xeb5\x96r\xb7A\x7f' >>> while 1: ... os.read(4,10) ... '\x16c\xab\x0b\x8b\xc5\xca\xd1\x95\xa9' ',\x06\x8dy\x95\xa9\xc5\xdb,\x06' '\x95\xa9\xc5\xdb,\x06\x8dy\x95\xa9' ',\x06\x8dy\x95\xa9\xc5\xdb,\x06' '\x95\xa9\xc5\xdb,\x06\x8dy\x95\xa9' So looks like everything works, and I'll close this bug. |