[Top][All Lists]

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

[Qemu-commits] [qemu/qemu] 4cae4d: hmp: fix regression of HMP device_del

From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 4cae4d: hmp: fix regression of HMP device_del auto-complet...
Date: Thu, 27 Nov 2014 08:00:07 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 4cae4d5acaea23f3def84c8dc67ef5106323e5cb
  Author: Marcel Apfelbaum <address@hidden>
  Date:   2014-11-27 (Thu, 27 Nov 2014)

  Changed paths:
    M hw/core/qdev.c
    M include/hw/qdev-core.h
    M monitor.c

  Log Message:
  hmp: fix regression of HMP device_del auto-completion

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:
    <qemu-bin> -enable-kvm  ~/images/fedora.qcow2 -monitor stdio -device 

    (qemu) device_del
 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 <address@hidden>
Reported-by: Gal Hammer <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>

reply via email to

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