[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 22/30] qom: Factor out user_creatable_process_cmdline()
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v3 22/30] qom: Factor out user_creatable_process_cmdline() |
Date: |
Mon, 15 Mar 2021 12:48:18 +0100 |
Am 13.03.2021 um 09:41 hat Markus Armbruster geschrieben:
> Observation, not objection:
>
> 1. QMP core parses JSON text into QObject, passes to generated
> marshaller.
>
> 2. Marshaller converts QObject to ObjectOptions with the QObject input
> visitor, passes to qmp_object_add().
>
> 3. qmp_object_add() wraps around user_creatable_add_qapi().
>
> 4. user_creatable_add_qapi() converts right back to QObject with the
> QObject output visitor. It splits the result into qom_type, id and
> the rest, and passes all three to user_creatable_add_type().
>
> 5. user_creatable_add_type() performs a virtual visit with the QObject
> input visitor. The outermost object it visits itself, its children
> it visits by calling object_property_set().
>
> I sure hope we wouldn't write it this way from scratch :)
>
> I think your patch is a reasonable step towards a QOM that is at peace
> with QAPI. But there's plenty of work left.
Yes, obviously the conversion back to QObject is not great. There are
two reasons why we currently need it:
1. user_creatable_add_type() wants to iterate over all properties
without knowing which properties exist. This should be fixed by not
visiting the top level in user_creatable_add_type(), but moving this
part to object-specific code (in the final state probably code
generated from the QAPI schema).
2. We have ObjectOptions, but need to pass a visitor. We don't have a
general purpose visitor that visits both sides. The clone visitor
seems somewhat similar to what we need, but I seem to remember it was
more restricted to its particular use case.
Kevin
- Re: [PATCH v3 27/30] hmp: QAPIfy object_add, (continued)
[PATCH v3 29/30] vl: QAPIfy -object, Kevin Wolf, 2021/03/08
[PATCH v3 16/30] qapi/qom: Add ObjectOptions for input-*, Kevin Wolf, 2021/03/08
[PATCH v3 22/30] qom: Factor out user_creatable_process_cmdline(), Kevin Wolf, 2021/03/08
[PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/03/08
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Eric Blake, 2021/03/08
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Markus Armbruster, 2021/03/13
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Paolo Bonzini, 2021/03/13
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Markus Armbruster, 2021/03/13
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/03/15
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Markus Armbruster, 2021/03/15
- Re: [PATCH v3 26/30] qemu-img: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/03/15
[PATCH v3 30/30] qom: Drop QemuOpts based interfaces, Kevin Wolf, 2021/03/08
[PATCH v3 15/30] qapi/qom: Add ObjectOptions for confidential-guest-support, Kevin Wolf, 2021/03/08