qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] segfault due to missing qdev_create()?


From: Hollis Blanchard
Subject: [Qemu-devel] segfault due to missing qdev_create()?
Date: Wed, 4 Aug 2010 11:27:54 -0700

I am able to run qemu with the following commandline:
/usr/local/bin/qemu-system-ppcemb -enable-kvm -kernel uImage.bamboo
-nographic -M bamboo ppc440-angstrom-linux.img

However, when I try to use virtio instead, I get this segfault:
/usr/local/bin/qemu-system-ppcemb -enable-kvm -kernel uImage.bamboo
-drive file=ppc440-angstrom-linux.img,if=virtio -nographic -M bamboo

#0  0x1009864c in qbus_find_recursive (bus=0x0, name=0x0, info=0x10287238)
    at /home/hollisb/work/qemu.git/hw/qdev.c:461
#1  0x10099cc4 in qdev_device_add (opts=0x108a07a0)
    at /home/hollisb/work/qemu.git/hw/qdev.c:229
#2  0x101a4220 in device_init_func (opts=<value optimized out>,
    opaque=<value optimized out>) at /home/hollisb/work/qemu.git/vl.c:1519
#3  0x1002baf8 in qemu_opts_foreach (list=<value optimized out>,
    func=0x101a4204 <device_init_func>, opaque=0x0,
    abort_on_failure=<value optimized out>) at qemu-option.c:978
#4  0x101a68e0 in main (argc=<value optimized out>,
    argv=<value optimized out>, envp=<value optimized out>)
    at /home/hollisb/work/qemu.git/vl.c:2890

This patch avoids the segfault, but just gives me this message: No
'PCI' bus found for device 'virtio-blk-pci'

diff --git a/hw/qdev.c b/hw/qdev.c
index e99c73f..8fe4f06 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -455,6 +455,9 @@ static BusState *qbus_find_recursive(BusState *bus, const ch
     BusState *child, *ret;
     int match = 1;

+       if (!bus)
+               return NULL;
+
     if (name && (strcmp(bus->name, name) != 0)) {
         match = 0;
     }

FWIW, hw/ppc4xx_pci.c is my PCI controller. Do I need to add some qdev
magic to that file to make this work?

-Hollis



reply via email to

[Prev in Thread] Current Thread [Next in Thread]