On 03/05/19 15:38, Michal Privoznik wrote:
On 2/28/19 10:31 AM, Laszlo Ersek wrote:
> On 02/27/19 11:04, Michal Privoznik wrote:
>> The firmware description is a JSON file which follows
>> specification from qemu.git/docs/interop/firmware.json. The
>> description file basically says: Firmware file X is {bios|uefi},
>> supports these targets and machine types, requires these features
>> to be enabled on qemu cmd line and this is how you put it onto
>> qemu cmd line.
>>
>> The firmware.json specification covers more (i.e. how to select
>> the right firmware) but that will be covered and implemented in
>> next commits.
>>
>> Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
>> ---
>> src/qemu/Makefile.inc.am | 2 +
>> src/qemu/qemu_firmware.c | 901 +++++++++++++++++++++++++++++++++++++++
>> src/qemu/qemu_firmware.h | 40 ++
>> 3 files changed, 943 insertions(+)
>> create mode 100644 src/qemu/qemu_firmware.c
>> create mode 100644 src/qemu/qemu_firmware.h
>
> Wow. I assumed the parser for the schema could be auto-generated from
> the schema JSON. Isn't that the case with the QMP commands and events?
Not really. We don't have any script to generate parser from qapi. We
did not need it so far too as we have a lot of logic in our QMP command
generation code.
Hmmm okay. If you generally interleave business logic and sanity checks
with QMP parsing (such as when processing events and command responses),
then I see the point. In the present case, the pattern is different
(first some larger-scale parsing, second heavy verification etc), but I
get the point of not adding a parser generator just for this.
Well, I'll let others review this patch then. :) Given the schema
definition, I think the patch can be verified regardless of the semantics.
Thanks
Laszlo