@@ -502,6 +502,23 @@ the enum). In the resulting generated C data types, a
flat union is
represented as a struct with the base members included directly, and
then a union of structures for each branch of the struct.
+If the discriminator points to an optional member of the base struct,
+its default value must be specified as a 'default-variant'. In the
+following example, the above BlockDriver struct is changed so it
+defaults to the 'file' driver if that field is omitted on the wire:
+
+ { 'union': 'BlockdevOptions',
+ 'base': { '*driver': 'BlockdevDriver', '*read-only': 'bool' },
+ 'discriminator': 'driver',
+ 'default-variant': 'file',
+ 'data': { 'file': 'BlockdevOptionsFile',
+ 'qcow2': 'BlockdevOptionsQcow2' } }
+
+Now the 'file' JSON object can be abbreviated to:
+
+ { "read-only": "true",
+ "filename": "/some/place/my-image" }
+