From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui79A-0002nk-Tx for qemu-devel@nongnu.org; Thu, 30 May 2013 14:00:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui796-00039l-CQ for qemu-devel@nongnu.org; Thu, 30 May 2013 14:00:20 -0400 Received: from [2001:41d0:8:2b42::1] (port=48592 helo=ns232118.ovh.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui796-00039R-4Z for qemu-devel@nongnu.org; Thu, 30 May 2013 14:00:16 -0400 Message-ID: <51A793A5.1020503@greensocs.com> Date: Thu, 30 May 2013 20:00:05 +0200 From: Frederic Konrad MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-rng: Fix crash with non-default backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cole Robinson Cc: amit.shah@redhat.com, mst@redhat.com, qemu-devel@nongnu.org, qemu-stable@nongnu.org Hi, On 30/05/2013 16:47, Cole Robinson wrote: > '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 Sorry for that :/, Can you do the same fix for: - s390 (hw/s390x/s390-virtio-bus.c:303) - ccw (hw/s390x/virtio-ccw.c:747) Thanks, Fred > CC: qemu-stable@nongnu.org > Signed-off-by: Cole Robinson > --- > hw/virtio/virtio-pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c > index 444b71a..b070b64 100644 > --- a/hw/virtio/virtio-pci.c > +++ b/hw/virtio/virtio-pci.c > @@ -1455,7 +1455,7 @@ static int virtio_rng_pci_init(VirtIOPCIProxy *vpci_dev) > } > > object_property_set_link(OBJECT(vrng), > - OBJECT(vrng->vdev.conf.default_backend), "rng", > + OBJECT(vrng->vdev.conf.rng), "rng", > NULL); > > return 0;