From 5b456438f5bb395ed6b1eec95e18ce7a7a884a0a Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 31 May 2013 14:12:48 -0400 Subject: 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 Acked-by: Amit Shah Acked-by: Michael S. Tsirkin Tested-by: Michael Roth Message-id: bf4505014a0a941dbd3c62068f3cf2c496b69e6a.1370023944.git.crobinso@redhat.com Signed-off-by: Anthony Liguori --- hw/s390x/virtio-ccw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/s390x/virtio-ccw.c') diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 44f5772bb2..201a635607 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)); -- cgit v1.2.3-55-g7522