Skip to content

Replace has_dynamic_sysbus with list of allowed device types

Eduardo Habkost qemu-arm qemu-devel xen-devel 1 version Applied

Status from this message: Queued on machine-next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest6 patches 18 repliesApplied

Changes v1 (RFC) -> v2 from the cover letter

* Patch 1 now just adds TYPE_SYS_BUS_DEVICE to the existing has_dynamic_sysbus=true machines, and other patches make the lists on each machine-type more specific.
* Change the name of the new field to allowed_dynamic_sysbus_devices.
* The q35 allowed list is much shorter because the list of user-creatable sysbus devices in QEMU is shorter.
* Keep the xen_set_dynamic_sysbus() hack, just change it to add 'xen-sysdev" to the allowed list.
* Simplified the arm/virt code.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6machine: Replace has_dynamic_sysbus with list of allowed deviceshw/arm/virt.c hw/core/machine.c hw/i386/pc_q35.c +4 more+48 -205 replies
2/6hw/arm/virt: Allow only supported dynamic sysbus deviceshw/arm/virt.c+4 -20 replies
3/6ppc: e500: Allow only supported dynamic sysbus deviceshw/ppc/e500plat.c+2 -25 replies
4/6spapr: Allow only supported dynamic sysbus deviceshw/ppc/spapr.c+1 -22 replies
5/6xen: Add only xen-sysdev to dynamic sysbus device listhw/xen/xen_backend.c+1 -62 replies
6/6q35: Allow only supported dynamic sysbus deviceshw/i386/pc_q35.c+4 -22 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchGreg KurzDavid GibsonMarcel ApfelbaumMarc-André LureauAnthony PERARD
1/6R-b R-b R-b R-b
2/6
3/6R-b A-b
4/6R-b A-b
5/6R-b A-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/6] Replace has_dynamic_sysbus with list of allowed device types

Changes v1 (RFC) -> v2:
* Patch 1 now just adds TYPE_SYS_BUS_DEVICE to the existing has_dynamic_sysbus=true machines, and other patches make the lists on each machine-type more specific.
* Change the name of the new field to allowed_dynamic_sysbus_devices.
* The q35 allowed list is much shorter because the list of user-creatable sysbus devices in QEMU is shorter.
* Keep the xen_set_dynamic_sysbus() hack, just change it to add 'xen-sysdev" to the allowed list.
* Simplified the arm/virt code.

Summary
-------

This series replaces the existing has_dynamic_sysbus flag (that makes the machine accept every user-creatable sysbus device type on the command-line) with a list of allowed devices.

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".

This will be useful to add support to new sysbus devices on machines like pc_piix, that don't have has_dynamic_sysbus set today.

This also makes the code safer: just compiling a new sysbus device in the same QEMU binary won't make a machine-type automatically start accepting the device.

Cc Marc-André Lureau <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Stefan Berger <[email protected]>
Cc Alexander Graf <[email protected]>

Eduardo Habkost (6):
machine: Replace has_dynamic_sysbus with list of allowed devices hw/arm/virt: Allow only supported dynamic sysbus devices
ppc: e500: Allow only supported dynamic sysbus devices
spapr: Allow only supported dynamic sysbus devices
xen: Add only xen-sysdev to dynamic sysbus device list
q35: Allow only supported dynamic sysbus devices

 include/hw/boards.h  |  5 ++++-
 hw/arm/virt.c        |  5 ++++-
 hw/core/machine.c    | 43 +++++++++++++++++++++++++++++--------------
 hw/i386/pc_q35.c     |  5 ++++-
 hw/ppc/e500plat.c    |  4 +++-
 hw/ppc/spapr.c       |  2 +-
 hw/xen/xen_backend.c |  2 +-
 7 files changed, 46 insertions(+), 20 deletions(-)
Signature · 1 line
2.13.6