Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0d5b5d39
Commit
0d5b5d39
authored
Feb 11, 2015
by
Rusty Russell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lguest: Convert entropy device to virtio 1.0 PCI.
Signed-off-by:
Rusty Russell
<
rusty@rustcorp.com.au
>
parent
bf6d4034
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
tools/lguest/lguest.c
tools/lguest/lguest.c
+7
-5
No files found.
tools/lguest/lguest.c
View file @
0d5b5d39
...
...
@@ -71,7 +71,7 @@ typedef uint8_t u8;
#include "../../include/uapi/linux/virtio_net.h"
#include "../../include/uapi/linux/virtio_blk.h"
#include <linux/virtio_console.h>
#include
<linux/virtio_rng.h>
#include
"../../include/uapi/linux/virtio_rng.h"
#include <linux/virtio_ring.h>
#include "../../include/uapi/linux/virtio_pci.h"
#include <asm/bootparam.h>
...
...
@@ -2224,7 +2224,6 @@ static void init_pci_config(struct pci_config *pci, u16 type,
*
* eg :
* VIRTIO_ID_CONSOLE: class = 0x07, subclass = 0x00
* VIRTIO_ID_RNG: class = 0xff, subclass = 0
*/
pci
->
class
=
class
;
pci
->
subclass
=
subclass
;
...
...
@@ -2816,13 +2815,16 @@ static void setup_rng(void)
rng_info
->
rfd
=
open_or_die
(
"/dev/urandom"
,
O_RDONLY
);
/* Create the new device. */
dev
=
new_
device
(
"rng"
,
VIRTIO_ID_RNG
);
dev
=
new_
pci_device
(
"rng"
,
VIRTIO_ID_RNG
,
0xff
,
0
);
dev
->
priv
=
rng_info
;
/* The device has one virtqueue, where the Guest places inbufs. */
add_
virtqueue
(
dev
,
VIRTQUEUE_NUM
,
rng_input
);
add_
pci_virtqueue
(
dev
,
rng_input
);
verbose
(
"device %u: rng
\n
"
,
devices
.
device_num
++
);
/* We don't have any configuration space */
no_device_config
(
dev
);
verbose
(
"device %u: rng
\n
"
,
devices
.
device_num
);
}
/* That's the end of device setup. */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment