Skip to content

RFC Replace has_dynamic_sysbus with device type whitelist

Eduardo Habkost qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest4 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xen: Don't force has_dynamic_sysbus on machine classhw/xen/xen_backend.c+0 -118 replies
2/4machine: Replace has_dynamic_sysbus with a whitelisthw/arm/sysbus-fdt.c hw/arm/virt.c hw/core/machine.c +5 more+83 -190 replies
3/4q35: Remove ioapic devices from sysbus whitelisthw/i386/pc_q35.c+0 -20 replies
4/4q35: Remove fw_cfg* from sysbus whitelisthw/i386/pc_q35.c+0 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [RFC 0/4] Replace has_dynamic_sysbus with device type whitelist

Summary
-------

This series replaces the existing has_dynamic_sysbus flag (that makes the machine accept every single sysbus device type on the command-line) with a short whitelist.

This will be helpful when implementing the new query-device-slots command, because each machine type will include only the sysbus devices it really supports, instead of including a catch-all TYPE_SYS_BUS_DEVICE "slot".

Most of the machines already have an internal whitelist implemented using foreach_dynamic_sysbus_device(), so we just encode the existing behavior inside the new MachineClass field.

Caveat: q35
-----------

The only problematic case is q35, that accepts all sysbus device types. In this case, instead of adding TYPE_SYS_BUS_DEVICE to the whitelist, I'm adding the existing list of existing sysbus device types to keep compatibility. After that, we can gradually and carefully remove unnecessary entries from the q35 whitelist.

Issue: xen_set_dynamic_sysbus() hack
------------------------------------

We still have an obstacle to get around: the callers of qdev_set_id() outside qdev_device_add() are breaking foreach_dynamic_sysbus_device(), and xen_set_dynamic_sysbus() is a workaround for that bug. We now need to fix that bug to be able to remove the xen_set_dynamic_sysbus() hack. This means the first patch of this series will probably break Xen, until we fix that bug.

Eduardo Habkost (4):
[UNTESTED] xen: Don't force has_dynamic_sysbus on machine class
machine: Replace has_dynamic_sysbus with a whitelist
q35: Remove ioapic devices from sysbus whitelist
q35: Remove fw_cfg* from sysbus whitelist

 include/hw/arm/sysbus-fdt.h |  7 +++++++
 include/hw/boards.h         |  3 ++-
 hw/arm/sysbus-fdt.c         | 10 ++++++++++
 hw/arm/virt.c               |  4 +++-
 hw/core/machine.c           | 43 +++++++++++++++++++++++++++++--------------
 hw/i386/pc_q35.c            | 25 ++++++++++++++++++++++++-
 hw/ppc/e500plat.c           |  4 +++-
 hw/ppc/spapr.c              |  2 +-
 hw/xen/xen_backend.c        | 11 -----------
 9 files changed, 79 insertions(+), 30 deletions(-)
Signature · 1 line
2.11.0.259.g40922b1