Skip to content

simplify usb enabling logic and fix a Qemu crash

Marcel Apfelbaum qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6hw/ppc: modified the condition for usb controllers to be created for some ppc machineshw/ppc/mac_newworld.c hw/ppc/spapr.c include/sysemu/sysemu.h +1 more+10 -31 reply
2/6hw/machine: added machine_usb wrapperhw/core/machine.c include/hw/boards.h+7 -00 replies
3/6hw/usb: simplified usb_enabledhw/arm/nseries.c hw/arm/pxa2xx.c hw/arm/realview.c +9 more+17 -180 replies
4/6hw/ppc/mac_newworld: QOMified mac99 machineshw/ppc/mac_newworld.c+19 -100 replies
5/6hw/ppc/spapr: simplify usb controller creation logichw/ppc/spapr.c+2 -110 replies
6/6hw/ppc/mac_newworld: simplify usb controller creation logichw/ppc/mac_newworld.c+2 -20 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchPaolo BonziniAlexander GrafStefan Hajnoczi
SeriesR-b R-b
1/6R-b
2/6
3/6
4/6
5/6
6/6

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/6] simplify usb enabling logic and fix a Qemu crash

Patch e79d5a6 ("machine: remove qemu_machine_opts global list") removed option descriptions from the -machine QemuOptsList to avoid repeating MachineState's QOM properties.

This resulted in a Qemu crash:

$ qemu-system-x86_64 -usb
qemu-system-x86_64: util/qemu-option.c:387: qemu_opt_get_bool_helper:
Assertion `opt->desc && opt->desc->type == QEMU_OPT_BOOL' failed.
Aborted (core dumped)

Fixed it by simplifying usb_enabled usage:
- removed the usb_enabled argument
- call directly to machine's QOM property.
- expose defaults_enabled to calling sites

As part of this series the semantics for some ppc machines to create the default usb controller were changed, but I still think is correct, please let me know if you see a problem there.

Based on the comments I will receive, I will continue to fix the options properties in the same way.

Marcel Apfelbaum (6):
hw/ppc: modified the condition for usb controllers to be created for
some ppc machines
hw/machine: added machine_usb wrapper
hw/usb: simplified usb_enabled
hw/ppc/mac_newworld: QOMified mac99 machines hw/ppc/spapr: simplify usb controller creation logic hw/ppc/mac_newworld: simplify usb controller creation logic

 hw/arm/nseries.c        |  2 +-
 hw/arm/pxa2xx.c         |  4 ++--
 hw/arm/realview.c       |  2 +-
 hw/arm/versatilepb.c    |  2 +-
 hw/core/machine.c       |  5 +++++
 hw/i386/pc_piix.c       |  2 +-
 hw/i386/pc_q35.c        |  2 +-
 hw/ppc/mac_newworld.c   | 32 +++++++++++++++++++++-----------
 hw/ppc/mac_oldworld.c   |  2 +-
 hw/ppc/prep.c           |  2 +-
 hw/ppc/spapr.c          |  3 ++-
 include/hw/boards.h     |  2 ++
 include/sysemu/sysemu.h |  3 ++-
 vl.c                    | 16 ++++++++++------
 14 files changed, 51 insertions(+), 28 deletions(-)
Signature · 1 line
2.1.0