mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
lib/launch-direct.c: Assume virtio-rng
It's always a good idea to provide proper entropy to the libguestfs appliance (eg. for any cryptographic operations). We already assume virtio, so we can assume virtio-rng is present.
This commit is contained in:
committed by
rwmjones
parent
d8b08eac38
commit
4872c0cf09
@@ -685,22 +685,16 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
|
||||
arg ("-kernel", kernel);
|
||||
arg ("-initrd", initrd);
|
||||
|
||||
/* Add a random number generator (backend for virtio-rng). This
|
||||
* isn't strictly necessary but means we won't need to hang around
|
||||
* when needing entropy.
|
||||
*/
|
||||
if (guestfs_int_qemu_supports_device (g, data->qemu_data,
|
||||
VIRTIO_DEVICE_NAME ("virtio-rng"))) {
|
||||
start_list ("-object") {
|
||||
append_list ("rng-random");
|
||||
append_list ("filename=/dev/urandom");
|
||||
append_list ("id=rng0");
|
||||
} end_list ();
|
||||
start_list ("-device") {
|
||||
append_list (VIRTIO_DEVICE_NAME ("virtio-rng"));
|
||||
append_list ("rng=rng0");
|
||||
} end_list ();
|
||||
}
|
||||
/* Add a good source of entropy, eg for cryptographic operations. */
|
||||
start_list ("-object") {
|
||||
append_list ("rng-random");
|
||||
append_list ("filename=/dev/urandom");
|
||||
append_list ("id=rng0");
|
||||
} end_list ();
|
||||
start_list ("-device") {
|
||||
append_list (VIRTIO_DEVICE_NAME ("virtio-rng"));
|
||||
append_list ("rng=rng0");
|
||||
} end_list ();
|
||||
|
||||
/* Create the virtio-scsi bus. */
|
||||
start_list ("-device") {
|
||||
|
||||
Reference in New Issue
Block a user