qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v2 0/8] qapi: add generator for Golang interface


From: Andrea Bolognani
Subject: Re: [RFC PATCH v2 0/8] qapi: add generator for Golang interface
Date: Tue, 5 Jul 2022 08:46:34 -0700

I've commented in detail to the single patches, just a couple of
additional points.


On Fri, Jun 17, 2022 at 02:19:24PM +0200, Victor Toso wrote:
> * 7) Flat structs by removing embed types. Discussion with Andrea
>      Thread: 
> https://lists.gnu.org/archive/html/qemu-devel/2022-05/msg01590.html
>
>      No one required it but I decided to give it a try. Major issue that
>      I see with this approach is to have generated a few 'Base' structs
>      that are now useless. Overall, less nested structs seems better to
>      me. Opnions?
>
>      Example:
>       | /* This is now useless, should be removed? */
>       | type InetSocketAddressBase struct {
>       |     Host string `json:"host"`
>       |     Port string `json:"port"`
>       | }

Can we somehow keep track, in the generator, of types that are only
used as building blocks for other types, and prevent them from
showing up in the generated code?


Finally, looking at the repository containing the generated code I
see that the generated type are sorted by kind, e.g. all unions are
in a file, all events in another one and so on. I believe the
structure should match more closely that of the QAPI schema, so e.g.
block-related types should all go in one file, net-related types in
another one and so on.


Looking forward to the next iteration :)

-- 
Andrea Bolognani / Red Hat / Virtualization




reply via email to

[Prev in Thread] Current Thread [Next in Thread]