[PATCH v4 0/3] vl: add -object support back into -readconfig

Paolo Bonzini posted 3 patches 2 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/next-importer-push tags/patchew/20210524105752.3318299-1-pbonzini@redhat.com
Maintainers: Markus Armbruster <armbru@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Max Reitz <mreitz@redhat.com>
include/block/qdict.h      |   2 -
include/qapi/qmp/qdict.h   |   3 ++
include/qemu/config-file.h |   7 ++-
softmmu/vl.c               | 105 +++++++++++++++++++++++++++----------
util/qemu-config.c         |  98 +++++++++++++++++++++++-----------
5 files changed, 153 insertions(+), 62 deletions(-)
[PATCH v4 0/3] vl: add -object support back into -readconfig
Posted by Paolo Bonzini 2 years, 11 months ago
LXD developers have reported that [object] stanzas have stopped
working in configuration files.

The problem is that QEMU 6.0 switched the creation of objects from
qemu_opts_foreach to a bespoke QTAILQ, in preparation for supporting
JSON syntax in -object.  Entries from the configuration file however
do not go through object_option_parse, and are thus lost.  Of the many
fixes that are possible, I chose one that is slightly more invasive but
more consistent with the plans for keyval-ification of options such as
-M and -accel.

-set was also broken by the same change.  For simplicity I chose
not to add it back yet, however this series will report the
breakage instead of failing silently.

The first two patches of this series are thus a reduced version of
https://patchew.org/QEMU/20210513162901.1310239-1-pbonzini@redhat.com/
([PATCH 00/14] vl: compound properties for machines and accelerators),
with the -set infrastructure removed.  The third is very simple and
uses the newly-provided hooks to parse objects from configuration files.

Paolo

Based-on: <20210518131542.2941207-1-pbonzini@redhat.com>

Paolo Bonzini (3):
  qemu-config: parse configuration files to a QDict
  vl: plumb keyval-based options into -readconfig
  vl: plug -object back into -readconfig

 include/block/qdict.h      |   2 -
 include/qapi/qmp/qdict.h   |   3 ++
 include/qemu/config-file.h |   7 ++-
 softmmu/vl.c               | 105 +++++++++++++++++++++++++++----------
 util/qemu-config.c         |  98 +++++++++++++++++++++++-----------
 5 files changed, 153 insertions(+), 62 deletions(-)

-- 
2.27.0


Re: [PATCH v4 0/3] vl: add -object support back into -readconfig
Posted by Markus Armbruster 2 years, 10 months ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> LXD developers have reported that [object] stanzas have stopped
> working in configuration files.
>
> The problem is that QEMU 6.0 switched the creation of objects from
> qemu_opts_foreach to a bespoke QTAILQ, in preparation for supporting
> JSON syntax in -object.  Entries from the configuration file however
> do not go through object_option_parse, and are thus lost.  Of the many
> fixes that are possible, I chose one that is slightly more invasive but
> more consistent with the plans for keyval-ification of options such as
> -M and -accel.
>
> -set was also broken by the same change.  For simplicity I chose
> not to add it back yet, however this series will report the
> breakage instead of failing silently.
>
> The first two patches of this series are thus a reduced version of
> https://patchew.org/QEMU/20210513162901.1310239-1-pbonzini@redhat.com/
> ([PATCH 00/14] vl: compound properties for machines and accelerators),
> with the -set infrastructure removed.  The third is very simple and
> uses the newly-provided hooks to parse objects from configuration files.
>
> Paolo
>
> Based-on: <20210518131542.2941207-1-pbonzini@redhat.com>

This series is now in master.  It doesn't fix the following regression:

    $ cat bug.cfg
    [chardev "mon0"]
      backend = "stdio"
    $ upstream-qemu -S -display none -readconfig bug.cfg
    upstream-qemu:bug.cfg:2: Invalid parameter 'id'
    [Exit 1 ]

Regressed in commit 3770141139 "qemu-config: parse configuration files
to a QDict".

Regressions are hard to avoid when automated tests are lacking.  You
touched it, you own it, now write the tests, please ;-P


Re: [PATCH v4 0/3] vl: add -object support back into -readconfig
Posted by Paolo Bonzini 2 years, 10 months ago
On 08/06/21 15:14, Markus Armbruster wrote:
> 
> Regressions are hard to avoid when automated tests are lacking.  You
> touched it, you own it, now write the tests, please;-P

Patch sent.  Tests will come too.

Paolo