mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
virtio-rng: Fix crash with non-default backend
'default_backend' isn't always set, but 'rng' is, so use that.
$ ./x86_64-softmmu/qemu-system-x86_64 -object rng-random,id=rng0,filename=/dev/random -device virtio-rng-pci,rng=rng0
Segmentation fault (core dumped)
Regressed with virtio refactoring in 59ccd20a9a
CC: qemu-stable@nongnu.org
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Message-id: bf4505014a0a941dbd3c62068f3cf2c496b69e6a.1370023944.git.crobinso@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
afd59989db
commit
5b456438f5
3 changed files with 3 additions and 3 deletions
|
@ -300,7 +300,7 @@ static int s390_virtio_rng_init(VirtIOS390Device *s390_dev)
|
|||
}
|
||||
|
||||
object_property_set_link(OBJECT(dev),
|
||||
OBJECT(dev->vdev.conf.default_backend), "rng",
|
||||
OBJECT(dev->vdev.conf.rng), "rng",
|
||||
NULL);
|
||||
|
||||
return s390_virtio_device_init(s390_dev, VIRTIO_DEVICE(vdev));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue