qapi: fix flat union on uncovered branches conditionals
PATCH 1/1 qapi: fix flat union on uncovered branches conditionals
Default branches variant should use the member conditional.
This fixes compilation with --disable-replication.
--- scripts/qapi/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/qapi/common.py +1 -1
@@ -1460,7 +1460,7 @@ class QAPISchemaObjectTypeVariants(object): cases = set([v.name for v in self.variants]) for m in self.tag_member.type.members: if m.name not in cases: - v = QAPISchemaObjectTypeVariant(m.name, 'q_empty') + v = QAPISchemaObjectTypeVariant(m.name, 'q_empty', m.ifcond) v.set_owner(self.tag_member.owner) self.variants.append(v) for v in self.variants:
Signature · 1 line
2.20.0
Quoted 16 lines · Marc-André Lureau
Default branches variant should use the member conditional.
This fixes compilation with --disable-replication.
Fixes 335d10cd8e2c3bb6067804b095aaf6371fc1983eSigned-off-by Marc-André Lureau <[email protected]>--- scripts/qapi/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/qapi/common.py +0
-0
scripts/qapi/common.py class QAPISchemaObjectTypeVariants(object): · line 1466
Quoted 8 lines
scripts/qapi/common.py +1
-1@@ -1460,7 +1460,7 @@ class QAPISchemaObjectTypeVariants(object): cases = set([v.name for v in self.variants]) for m in self.tag_member.type.members: if m.name not in cases: - v = QAPISchemaObjectTypeVariant(m.name, 'q_empty') + v = QAPISchemaObjectTypeVariant(m.name, 'q_empty', m.ifcond) v.set_owner(self.tag_member.owner) self.variants.append(v) for v in self.variants:
Long line, happy to wrap it when I apply.
I append the diff of generated code.
qapi-introspect.c +2 -0
@@ -10068,11 +10068,13 @@ const QLitObject qmp_schema_qlit = QLIT_ { "type", QLIT_QSTR("0"), }, {} })), +#if defined(CONFIG_REPLICATION) QLIT_QDICT(((QLitDictEntry[]) { { "case", QLIT_QSTR("replication"), }, { "type", QLIT_QSTR("0"), }, {} })), +#endif /* defined(CONFIG_REPLICATION) */ QLIT_QDICT(((QLitDictEntry[]) { { "case", QLIT_QSTR("throttle"), }, { "type", QLIT_QSTR("0"), },
qapi-visit-block-core.c +2 -0
@@ -7175,8 +7175,10 @@ void visit_type_BlockdevCreateOptions_mebreak ;case BLOCKDEV_DRIVER_RAW :break ; +#if defined(CONFIG_REPLICATION )case BLOCKDEV_DRIVER_REPLICATION :break ; +#endif /* defined(CONFIG_REPLICATION) */ case BLOCKDEV_DRIVER_THROTTLE :break ;case BLOCKDEV_DRIVER_VMDK :
Markus Armbruster
AppliedQuoted 7 lines · Marc-André Lureau
Default branches variant should use the member conditional.
This fixes compilation with --disable-replication.
Fixes 335d10cd8e2c3bb6067804b095aaf6371fc1983eSigned-off-by Marc-André Lureau <[email protected]>
Queued, thanks!
Quoted 16 lines · Marc-André Lureau
Default branches variant should use the member conditional.
This fixes compilation with --disable-replication.
Fixes 335d10cd8e2c3bb6067804b095aaf6371fc1983eSigned-off-by Marc-André Lureau <[email protected]>--- scripts/qapi/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/qapi/common.py +0
-0
scripts/qapi/common.py class QAPISchemaObjectTypeVariants(object): · line 1466
Quoted 8 lines
scripts/qapi/common.py +1
-1@@ -1460,7 +1460,7 @@ class QAPISchemaObjectTypeVariants(object): cases = set([v.name for v in self.variants]) for m in self.tag_member.type.members: if m.name not in cases: - v = QAPISchemaObjectTypeVariant(m.name, 'q_empty') + v = QAPISchemaObjectTypeVariant(m.name, 'q_empty', m.ifcond) v.set_owner(self.tag_member.owner) self.variants.append(v) for v in self.variants:
This fixes the compilation problem for me, indeed!