aboutsummaryrefslogtreecommitdiffstats
path: root/tools/lguest
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-02-10 23:45:09 -0500
committerRusty Russell <rusty@rustcorp.com.au>2015-02-11 01:17:28 -0500
commita454bb36cabdac163fcd80ddb37662893ea603f1 (patch)
tree3156d7cd5cb5c30cd3ea78f8101cc67bdbb1c3bb /tools/lguest
parentbe8ff5952a8d943660d3c01f1abf4e71eb565fdb (diff)
lguest: have --rng read from /dev/urandom not /dev/random.
Theoretical debates aside, now it boots. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools/lguest')
-rw-r--r--tools/lguest/lguest.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c
index 32cf2ce15d69..3f7f2326cd9a 100644
--- a/tools/lguest/lguest.c
+++ b/tools/lguest/lguest.c
@@ -1733,9 +1733,9 @@ static void setup_block_file(const char *filename)
1733} 1733}
1734 1734
1735/*L:211 1735/*L:211
1736 * Our random number generator device reads from /dev/random into the Guest's 1736 * Our random number generator device reads from /dev/urandom into the Guest's
1737 * input buffers. The usual case is that the Guest doesn't want random numbers 1737 * input buffers. The usual case is that the Guest doesn't want random numbers
1738 * and so has no buffers although /dev/random is still readable, whereas 1738 * and so has no buffers although /dev/urandom is still readable, whereas
1739 * console is the reverse. 1739 * console is the reverse.
1740 * 1740 *
1741 * The same logic applies, however. 1741 * The same logic applies, however.
@@ -1763,7 +1763,7 @@ static void rng_input(struct virtqueue *vq)
1763 while (!iov_empty(iov, in_num)) { 1763 while (!iov_empty(iov, in_num)) {
1764 len = readv(rng_info->rfd, iov, in_num); 1764 len = readv(rng_info->rfd, iov, in_num);
1765 if (len <= 0) 1765 if (len <= 0)
1766 err(1, "Read from /dev/random gave %i", len); 1766 err(1, "Read from /dev/urandom gave %i", len);
1767 iov_consume(iov, in_num, NULL, len); 1767 iov_consume(iov, in_num, NULL, len);
1768 totlen += len; 1768 totlen += len;
1769 } 1769 }
@@ -1780,8 +1780,8 @@ static void setup_rng(void)
1780 struct device *dev; 1780 struct device *dev;
1781 struct rng_info *rng_info = malloc(sizeof(*rng_info)); 1781 struct rng_info *rng_info = malloc(sizeof(*rng_info));
1782 1782
1783 /* Our device's privat info simply contains the /dev/random fd. */ 1783 /* Our device's private info simply contains the /dev/urandom fd. */
1784 rng_info->rfd = open_or_die("/dev/random", O_RDONLY); 1784 rng_info->rfd = open_or_die("/dev/urandom", O_RDONLY);
1785 1785
1786 /* Create the new device. */ 1786 /* Create the new device. */
1787 dev = new_device("rng", VIRTIO_ID_RNG); 1787 dev = new_device("rng", VIRTIO_ID_RNG);