Received: from eggs.gnu.org ([2001:4830:134:3::10]:33271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W46aK-0008Ll-17 for qemu-devel@nongnu.org; Fri, 17 Jan 2014 05:23:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W46aC-0006uC-Uy for qemu-devel@nongnu.org; Fri, 17 Jan 2014 05:23:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28597) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W46aC-0006u5-Md for qemu-devel@nongnu.org; Fri, 17 Jan 2014 05:23:24 -0500 From: Markus Armbruster Date: Fri, 17 Jan 2014 11:23:21 +0100 Message-ID: <87ppnq6h5y.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] device_add error handling regressed in v1.5.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Andreas =?utf-8?Q?F=C3=A4rber?= Watch this: $ upstream-qemu -nodefaults -S -display none -monitor stdio QEMU 1.7.50 monitor - type 'help' for more information (qemu) device_add e1000,netdev=xxx Property 'e1000.netdev' can't find value 'xxx' (qemu) info qtree bus: main-system-bus type System dev: hpet, id "" gpio-in 2 gpio-out 1 timers = 3 msi = off hpet-intcap = 4 irq 32 mmio 00000000fed00000/0000000000000400 dev: ioapic, id "" gpio-in 24 irq 0 mmio 00000000fec00000/0000000000001000 dev: i440FX-pcihost, id "" pci-hole64-size = 16777216.000T short_root_bus = 0 irq 0 bus: pci.0 type PCI dev: e1000, id "" mac = 00:00:00:00:00:00 vlan = netdev = bootindex = -1 autonegotiation = on mitigation = on addr = romfile = rombar = 1 multifunction = off command_serr_enable = on Segmentation fault (core dumped) Even though device_add failed, it still created a node in the qtree! Same issue observed with scsi-hd. Looks like a qdev problem, not a device problem. git-bisect blames this one: e0a83fc2c1582dc8d4453849852ebe6c258b7c3a is the first bad commit commit e0a83fc2c1582dc8d4453849852ebe6c258b7c3a Author: Paolo Bonzini Date: Tue Apr 2 15:50:00 2013 +0200 qom: do nothing on unparent of object without parent Otherwise, device_unparent will fail to get a canonical path of the object. Signed-off-by: Paolo Bonzini Message-id: 1364910600-3418-1-git-send-email-pbonzini@redhat.com Signed-off-by: Anthony Liguori