]> git.proxmox.com Git - mirror_qemu.git/commit - qdev-monitor.c
qdev: Use qdev_get_device_class() for -device <type>,help
authorEduardo Habkost <ehabkost@redhat.com>
Sat, 1 Nov 2014 15:56:11 +0000 (13:56 -0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 4 Nov 2014 16:50:00 +0000 (17:50 +0100)
commit31bed5509dfcbdfc293154ce81086a4dbd7a80b6
treef0fb787080a8bf9aea449baaed1e08e373e1f819
parent5185f0e0a6bb076cd1cd0115ef785298a97a71fe
qdev: Use qdev_get_device_class() for -device <type>,help

Make sure we try to list properties from classes that can be safely used
with "-device".

Fixes the following crashes:

  $ qemu-system-x86_64 -device x86_64-cpu,help
  **
  ERROR:qom/object.c:336:object_initialize_with_type: assertion failed: (type->abstract == false)
  Aborted (core dumped)
  $ qemu-system-x86_64 -device host-x86_64-cpu,help
  qemu-system-x86_64: [...]/target-i386/cpu.c:1329: host_x86_cpu_initfn: Assertion `(kvm_allowed)' failed.
  Aborted (core dumped)

After applying this patch:

  $ qemu-system-x86_64 -device x86_64-cpu,help
  Parameter 'driver' expects non-abstract device type
  $ qemu-system-x86_64 -device host-x86_64-cpu,help
  Parameter 'driver' expects pluggable device type

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
qdev-monitor.c