Marc-André Lureau <marcandre.lur...@redhat.com> writes: > Hi > > ----- Original Message ----- >> Marc-André Lureau <marcandre.lur...@redhat.com> writes: >> >> > Take 'if' from expression, and use it to construct entity objects. >> > Shared implicit objects must share the same 'if' condition. >> >> Shared by what? > > Shared by various make_implicit_object_type() users.
The only ones that are shared right now are simple union wrappers. For those, you pick a condition that isn't tight, but works. Now we need to work that into the commit message. Perhaps: qapi: Pass 'if' condition into QAPISchemaEntity objects Built-in objects remain unconditional. Explicitly defined objects use the condition specified in the schema. Implicitly defined objects inherit their condition from their users. For most of them, there is exactly one user, so the condition to use is obvious. The exception is the wrapper types generated for simple union variants, which can be shared by any number of simple unions. The tight condition would be the disjunction of the conditions of these simple unions. For now, use wrapped type's condition instead. Much simpler and good enough for now. [...]