]> git.ipfire.org Git - thirdparty/qemu.git/commit
qemu-config: parse configuration files to a QDict
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 24 May 2021 10:57:50 +0000 (06:57 -0400)
committerMichael Roth <michael.roth@amd.com>
Thu, 14 Oct 2021 20:30:01 +0000 (15:30 -0500)
commit203f0ba14434057d6ea1fef15a34694965771837
tree2b4a35d66b87eff6471f3567e79e3f213497e81c
parent701ff59cc42e5812c1cd024a07b4802f19e0fd2a
qemu-config: parse configuration files to a QDict

Change the parser to put the values into a QDict and pass them
to a callback.  qemu_config_parse's QemuOpts creation is
itself turned into a callback function.

This is useful for -readconfig to support keyval-based options;
getting a QDict from the parser removes a roundtrip from
QDict to QemuOpts and then back to QDict.

Unfortunately there is a disadvantage in that semantic errors will
point to the last line of the group, because the entries of the QDict
do not have a location attached.

Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210524105752.3318299-2-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 37701411397c7b7d709ae92abd347cc593940ee5)
Signed-off-by: Michael Roth <michael.roth@amd.com>
include/qemu/config-file.h
softmmu/vl.c
util/qemu-config.c