From patchwork Thu May 30 14:47:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 247622 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BB5322C009C for ; Fri, 31 May 2013 00:48:11 +1000 (EST) Received: from localhost ([::1]:39811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui49B-0002rk-SF for incoming@patchwork.ozlabs.org; Thu, 30 May 2013 10:48:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui48p-0002rM-02 for qemu-devel@nongnu.org; Thu, 30 May 2013 10:47:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ui48k-0005kq-DI for qemu-devel@nongnu.org; Thu, 30 May 2013 10:47:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ui48k-0005hK-5n; Thu, 30 May 2013 10:47:42 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4UElbkD029379 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 May 2013 10:47:37 -0400 Received: from colepc.redhat.com (ovpn-113-144.phx2.redhat.com [10.3.113.144]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r4UElao5018709; Thu, 30 May 2013 10:47:36 -0400 From: Cole Robinson To: qemu-devel@nongnu.org Date: Thu, 30 May 2013 10:47:20 -0400 Message-Id: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: amit.shah@redhat.com, Cole Robinson , fred.konrad@greensocs.com, qemu-stable@nongnu.org, mst@redhat.com Subject: [Qemu-devel] [PATCH] virtio-rng: Fix crash with non-default backend X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org '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 --- 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;