From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: yang.zhong@intel.com, berrange@redhat.com, ehabkost@redhat.com,
armbru@redhat.com
Subject: [PATCH 00/14] vl: compound properties for machines and accelerators
Date: Thu, 13 May 2021 12:28:47 -0400 [thread overview]
Message-ID: <20210513162901.1310239-1-pbonzini@redhat.com> (raw)
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(-)
--
2.26.2
next reply other threads:[~2021-05-13 16:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 16:28 Paolo Bonzini [this message]
2021-05-13 16:28 ` [PATCH 01/14] remove -writeconfig Paolo Bonzini
2021-05-13 16:28 ` [PATCH 02/14] qemu-config: parse configuration files to a QDict Paolo Bonzini
2021-05-13 16:28 ` [PATCH 03/14] vl: plumb keyval-based options into -set and -readconfig Paolo Bonzini
2021-05-13 16:28 ` [PATCH 04/14] qom: export more functions for use with non-UserCreatable objects Paolo Bonzini
2021-05-13 16:28 ` [PATCH 05/14] keyval: introduce keyval_parse_into Paolo Bonzini
2021-05-13 16:28 ` [PATCH 06/14] vl: switch -M parsing to keyval Paolo Bonzini
2021-05-13 16:28 ` [PATCH 07/14] qemu-option: remove now-dead code Paolo Bonzini
2021-05-13 16:28 ` [PATCH 08/14] vl: switch -accel parsing to keyval Paolo Bonzini
2021-05-13 16:28 ` [PATCH 09/14] machine: move dies from X86MachineState to CpuTopology Paolo Bonzini
2021-05-13 16:28 ` [PATCH 10/14] machine: move common smp_parse code to caller Paolo Bonzini
2021-05-13 16:28 ` [PATCH 11/14] machine: add error propagation to mc->smp_parse Paolo Bonzini
2021-05-13 16:28 ` [PATCH 12/14] machine: pass QAPI struct " Paolo Bonzini
2021-05-13 16:29 ` [PATCH 13/14] machine: reject -smp dies!=1 for non-PC machines Paolo Bonzini
2021-05-13 16:29 ` [PATCH 14/14] machine: add smp compound property Paolo Bonzini
2021-05-17 14:58 ` Igor Mammedov
2021-05-13 16:57 ` [PATCH 00/14] vl: compound properties for machines and accelerators no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210513162901.1310239-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yang.zhong@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).