From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu1OM-0004oo-Po for qemu-devel@nongnu.org; Thu, 27 Nov 2014 10:54:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xu1OG-0003NK-L0 for qemu-devel@nongnu.org; Thu, 27 Nov 2014 10:54:02 -0500 Received: from mail-la0-f54.google.com ([209.85.215.54]:40195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu1OG-0003NE-DO for qemu-devel@nongnu.org; Thu, 27 Nov 2014 10:53:56 -0500 Received: by mail-la0-f54.google.com with SMTP id gf13so4295705lab.41 for ; Thu, 27 Nov 2014 07:53:55 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1417002601-20799-1-git-send-email-marcel.a@redhat.com> References: <1417002601-20799-1-git-send-email-marcel.a@redhat.com> From: Peter Maydell Date: Thu, 27 Nov 2014 15:53:34 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] hmp: fix regression of HMP device_del auto-completion List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: Igor Mammedov , zhugh.fnst@cn.fujitsu.com, QEMU Developers , Luiz Capitulino On 26 November 2014 at 11:50, Marcel Apfelbaum wrote: > The commits: > - 6a1fa9f5 (monitor: add del completion for peripheral device) > - 66e56b13 (qdev: add qdev_build_hotpluggable_device_list helper) > > cause a QEMU crash when trying to use HMP device_del auto-completion. > It can be easily reproduced by: > -enable-kvm ~/images/fedora.qcow2 -monitor stdio -device virtio-net-pci,id=vnet > > (qemu) device_del > /home/mapfelba/git/upstream/qemu/hw/core/qdev.c:941:qdev_build_hotpluggable_device_list: Object 0x7f6ce04e4fe0 is not an instance of type device > Aborted (core dumped) > > The root cause is qdev_build_hotpluggable_device_list going recursively over > all peripherals and their children assuming all are devices. It doesn't work > since PCI devices have at least on child which is a memory region (bus master). > > Solved by observing that all devices appear as direct children of > /machine/peripheral container. No need of going recursively > over all the children. > > Signed-off-by: Marcel Apfelbaum Applied, thanks. -- PMM