aboutsummaryrefslogtreecommitdiff
path: root/hw/s390x
diff options
context:
space:
mode:
authorCole Robinson <crobinso@redhat.com>2013-05-31 14:12:48 -0400
committerMichael Roth <mdroth@linux.vnet.ibm.com>2013-06-18 13:03:12 -0500
commit12e5b2b5dafeed4c14080f3c1ff40e3db9802433 (patch)
treed1852cd849211fdcd77004dc4a75b56d0be88039 /hw/s390x
parentcb55efe6dba9b377d23b69a2d1c78b2ccdb5ec7d (diff)
downloadqemu-12e5b2b5dafeed4c14080f3c1ff40e3db9802433.zip
qemu-12e5b2b5dafeed4c14080f3c1ff40e3db9802433.tar.gz
qemu-12e5b2b5dafeed4c14080f3c1ff40e3db9802433.tar.bz2
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 59ccd20a9ac719cff82180429458728f03ec612f 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> (cherry picked from commit 5b456438f5bb395ed6b1eec95e18ce7a7a884a0a) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'hw/s390x')
-rw-r--r--hw/s390x/s390-virtio-bus.c2
-rw-r--r--hw/s390x/virtio-ccw.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index a1cdfb0..207eb82 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -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));
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 44f5772..201a635 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -744,7 +744,7 @@ static int virtio_ccw_rng_init(VirtioCcwDevice *ccw_dev)
}
object_property_set_link(OBJECT(dev),
- OBJECT(dev->vdev.conf.default_backend), "rng",
+ OBJECT(dev->vdev.conf.rng), "rng",
NULL);
return virtio_ccw_device_init(ccw_dev, VIRTIO_DEVICE(vdev));