Skip to content
  • Eduardo Habkost's avatar
    qdev: Use qdev_get_device_class() for -device <type>,help · 31bed550
    Eduardo Habkost authored
    
    
    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: default avatarEduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
    31bed550