Skip to content

vl: compound properties for machines and accelerators

Paolo Bonzini qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest14 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14remove -writeconfigdocs/system/deprecated.rst docs/system/removed-features.rst include/qemu/config-file.h +3 more+8 -760 replies
2/14qemu-config: parse configuration files to a QDictinclude/qemu/config-file.h softmmu/vl.c util/qemu-config.c+68 -330 replies
3/14vl: plumb keyval-based options into -set and -readconfiginclude/block/qdict.h include/qapi/qmp/qdict.h include/qemu/option.h +3 more+232 -230 replies
4/14qom: export more functions for use with non-UserCreatable objectsinclude/qom/object.h qom/object_interfaces.c+65 -160 replies
5/14keyval: introduce keyval_parse_intoinclude/qemu/option.h util/keyval.c+37 -80 replies
6/14vl: switch -M parsing to keyvalsoftmmu/vl.c+141 -1620 replies
7/14qemu-option: remove now-dead codeinclude/qemu/option.h tests/unit/test-qemu-opts.c util/qemu-option.c+10 -790 replies
8/14vl: switch -accel parsing to keyvalaccel/accel-softmmu.c include/qemu/accel.h softmmu/vl.c+87 -760 replies
9/14machine: move dies from X86MachineState to CpuTopologyhw/core/machine.c hw/i386/pc.c hw/i386/x86.c +3 more+10 -130 replies
10/14machine: move common smp_parse code to callerhw/core/machine.c hw/i386/pc.c+110 -1180 replies
11/14machine: add error propagation to mc->smp_parsehw/core/machine.c hw/i386/pc.c include/hw/boards.h +1 more+34 -320 replies
12/14machine: pass QAPI struct to mc->smp_parsehw/core/machine.c hw/i386/pc.c include/hw/boards.h +1 more+59 -210 replies
13/14machine: reject -smp dies!=1 for non-PC machineshw/core/machine.c+4 -00 replies
14/14machine: add smp compound propertyhw/core/machine.c softmmu/vl.c tests/qtest/numa-test.c+95 -681 reply

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 00/14] vl: compound properties for machines and accelerators

This series converts -M and -accel to keyval parsing, so that they can use compound properties. The series also converts -smp to a compound property.

This is also a preparatory work for SGX support, which would like to use an array-type machine property.

Patch 1 removes -writeconfig, which would not be able to cope with -M and -accel after the conversion. This is much earlier than the usual deprecation schedule, as the option was deprecated in 6.0 only. So, if people prefer that, I will add the required support to -writeconfig. For now this was the simplest way to get something that works.

Patches 2-5 introduce the infrastructure and the new functions that let us support keyval-based options in -readconfig, without going through QemuOpts.

Patches 6-8 do the actual switch of -M and -accel to keyval.

Patches 9-14 finally validate the concept by implementing -smp as a compound property; that is "-smp X=Y" is converted to "-machine smp.X=Y" automatically. Really the only interesting patches are 12 and 14, while the others are just cleanups.

The series only supports JSON syntax for -accel. It is more complicated for -M because we need to consider what happens if string-based dictionaries (produced by -M key=val) have to be merged with strongly-typed dictionaries (produced by -M {'key': 123}).

The plan is to only allow one -M option when JSON syntax is in use; the problem is that this is a forwards-compatibility landmine. As soon as -smp is converted, for example, -smp becomes a shortcut for -M and it is now forbidden to use -M '{....}' together with -smp. It would be impossible to know which options in the future will become incompatible with -M JSON syntax. Therefore, support for JSON syntax is delayed until after the main options are converted to QOM compound properties. These could be -boot, -acpitable, -smbios, -m, -semihosting-config, -rtc and -fw_cfg.

Paolo

Paolo Bonzini (14):
remove -writeconfig
qemu-config: parse configuration files to a QDict
vl: plumb keyval-based options into -set and -readconfig
qom: export more functions for use with non-UserCreatable objects
keyval: introduce keyval_parse_into
vl: switch -M parsing to keyval
qemu-option: remove now-dead code
vl: switch -accel parsing to keyval
machine: move dies from X86MachineState to CpuTopology
machine: move common smp_parse code to caller
machine: add error propagation to mc->smp_parse
machine: pass QAPI struct to mc->smp_parse
machine: reject -smp dies!=1 for non-PC machines
machine: add smp compound property

 accel/accel-softmmu.c            |   6 +
 docs/system/deprecated.rst       |   7 -
 docs/system/removed-features.rst |   6 +
 hw/core/machine.c                | 184 +++++----
 hw/i386/pc.c                     | 108 +++--
 hw/i386/x86.c                    |  15 +-
 include/block/qdict.h            |   2 -
 include/hw/boards.h              |   3 +-
 include/hw/i386/pc.h             |   3 -
 include/hw/i386/x86.h            |   1 -
 include/qapi/qmp/qdict.h         |   3 +
 include/qemu/accel.h             |   1 +
 include/qemu/config-file.h       |   7 +-
 include/qemu/option.h            |   6 +-
 include/qom/object.h             |  23 ++
 qapi/machine.json                |  27 ++
 qemu-options.hx                  |   8 +-
 qom/object_interfaces.c          |  58 ++-
 softmmu/vl.c                     | 652 +++++++++++++++++--------------
 tests/qtest/numa-test.c          |  22 +-
 tests/unit/test-keyval.c         |  56 +++
 tests/unit/test-qemu-opts.c      |  35 --
 util/keyval.c                    |  90 ++++-
 util/qemu-config.c               | 133 +++----
 util/qemu-option.c               |  51 +--
 25 files changed, 871 insertions(+), 636 deletions(-)
Signature · 1 line
2.26.2