Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regenerate against QEMU 7.1.0 #191

Closed
wants to merge 4 commits into from
Closed

Conversation

connorkuehl
Copy link
Contributor

I am assuming but am not entirely sure that the restriction against generating lists of interface types as a field (simple union, flat union, and alternate) is because those generators generate structs of their own whose names collide with preexisting structs.

The first commit lifts that restriction and also adds the word "Variant" as a prefix to these types, thus removing the name collisions. There's additional reasoning in the commit as to why that is.

I've also removed a test that starts failing but that is because newer versions of the QEMU API define that type as a discriminated union instead of a flat union, and our code generator currently (on master) generates stack overflows when trying to marshal a discriminated union. I've filed #190 for that.


Depends on #189
Closes #188
Closes #187

Base automatically changed from modern-qapi to master December 9, 2022 21:00
If generating against a QEMU distribution that has unions with base
fields, the code generator would generate structs that conflict with
each other. For example, BlockdevOptions results in code generation with
a number of structs with the same name (i.e., "BlockdevOptionsGluster"),
where you'd see a struct emitted for the variant that contains the base
member fields and also a standalone BlockdevOptionsGluster which is
defined separately in a QAPI document.

Because of how union bases work, they are technically distinct structs,
so make them distinct.
The KeyValue union changes from a simple union to a flat union with a
discriminator and currently code generation for flat unions generates
MarshalJSON methods that recurse infinitely.
@connorkuehl connorkuehl marked this pull request as ready for review December 9, 2022 21:03
@connorkuehl connorkuehl requested a review from a team as a code owner December 9, 2022 21:03
@connorkuehl connorkuehl closed this Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant