@@ -156,6 +156,7 @@ from making a forward reference to a type that is only introduced by
156156an outer file. The parser may be made stricter in the future to
157157prevent incomplete include files.
158158
159+ .. _pragma :
159160
160161Pragma directives
161162-----------------
@@ -186,6 +187,7 @@ Pragma 'member-name-exceptions' takes a list of types whose member
186187names may contain uppercase letters, and ``"_" `` instead of ``"-" ``.
187188Default is none.
188189
190+ .. _ENUM-VALUE :
189191
190192Enumeration types
191193-----------------
@@ -228,13 +230,15 @@ additional enumeration constant PREFIX__MAX with value N.
228230Do not use string or an integer type when an enumeration type can do
229231the job satisfactorily.
230232
231- The optional 'if' member specifies a conditional. See " Configuring
232- the schema" below for more on this.
233+ The optional 'if' member specifies a conditional. See ` Configuring the
234+ schema `_ below for more on this.
233235
234- The optional 'features' member specifies features. See "Features"
236+ The optional 'features' member specifies features. See Features _
235237below for more on this.
236238
237239
240+ .. _TYPE-REF :
241+
238242Type references and array types
239243-------------------------------
240244
@@ -269,11 +273,13 @@ Member 'struct' names the struct type.
269273
270274Each MEMBER of the 'data' object defines a member of the struct type.
271275
276+ .. _MEMBERS :
277+
272278The MEMBER's STRING name consists of an optional ``* `` prefix and the
273279struct member name. If ``* `` is present, the member is optional.
274280
275281The MEMBER's value defines its properties, in particular its type.
276- The form TYPE-REF is shorthand for :code: `{ 'type': TYPE-REF } `.
282+ The form TYPE-REF _ is shorthand for :code: `{ 'type': TYPE-REF } `.
277283
278284Example::
279285
@@ -300,10 +306,10 @@ both members like this::
300306 { "file": "/some/place/my-image",
301307 "backing": "/some/place/my-backing-file" }
302308
303- The optional 'if' member specifies a conditional. See " Configuring
304- the schema" below for more on this.
309+ The optional 'if' member specifies a conditional. See ` Configuring
310+ the schema `_ below for more on this.
305311
306- The optional 'features' member specifies features. See "Features"
312+ The optional 'features' member specifies features. See Features _
307313below for more on this.
308314
309315
@@ -337,7 +343,7 @@ union must have at least one branch.
337343The BRANCH's STRING name is the branch name.
338344
339345The BRANCH's value defines the branch's properties, in particular its
340- type. The form TYPE-REF is shorthand for :code: `{ 'type': TYPE-REF } `.
346+ type. The form TYPE-REF _ is shorthand for :code: `{ 'type': TYPE-REF } `.
341347
342348A simple union type defines a mapping from automatic discriminator
343349values to data types like in this example::
@@ -368,12 +374,12 @@ Flat unions permit arbitrary common members that occur in all variants
368374of the union, not just a discriminator. Their discriminators need not
369375be named 'type'. They also avoid nesting on the wire.
370376
371- The 'base' member defines the common members. If it is a MEMBERS
377+ The 'base' member defines the common members. If it is a MEMBERS _
372378object, it defines common members just like a struct type's 'data'
373379member defines struct type members. If it is a STRING, it names a
374380struct type whose members are the common members.
375381
376- All flat union branches must be of struct type .
382+ All flat union branches must be ` Struct types `_ .
377383
378384In the Client JSON Protocol, a flat union is represented by an object
379385with the common members (from the base type) and the selected branch's
@@ -425,10 +431,10 @@ is identical on the wire to::
425431 { 'union': 'Flat', 'base': { 'type': 'Enum' }, 'discriminator': 'type',
426432 'data': { 'one': 'Branch1', 'two': 'Branch2' } }
427433
428- The optional 'if' member specifies a conditional. See " Configuring
429- the schema" below for more on this.
434+ The optional 'if' member specifies a conditional. See ` Configuring
435+ the schema `_ below for more on this.
430436
431- The optional 'features' member specifies features. See "Features"
437+ The optional 'features' member specifies features. See Features _
432438below for more on this.
433439
434440
@@ -481,10 +487,10 @@ following example objects::
481487 "read-only": false,
482488 "filename": "/tmp/mydisk.qcow2" } }
483489
484- The optional 'if' member specifies a conditional. See " Configuring
485- the schema" below for more on this.
490+ The optional 'if' member specifies a conditional. See ` Configuring
491+ the schema `_ below for more on this.
486492
487- The optional 'features' member specifies features. See "Features"
493+ The optional 'features' member specifies features. See Features _
488494below for more on this.
489495
490496
@@ -511,10 +517,10 @@ Syntax::
511517
512518Member 'command' names the command.
513519
514- Member 'data' defines the arguments. It defaults to an empty MEMBERS
520+ Member 'data' defines the arguments. It defaults to an empty MEMBERS _
515521object.
516522
517- If 'data' is a MEMBERS object, then MEMBERS defines arguments just
523+ If 'data' is a MEMBERS _ object, then MEMBERS defines arguments just
518524like a struct type's 'data' defines struct type members.
519525
520526If 'data' is a STRING, then STRING names a complex type whose members
@@ -553,7 +559,7 @@ which would validate this Client JSON Protocol transaction::
553559
554560The generator emits a prototype for the C function implementing the
555561command. The function itself needs to be written by hand. See
556- section " Code generated for commands" for examples.
562+ section ` Code generated for commands `_ for examples.
557563
558564The function returns the return type. When member 'boxed' is absent,
559565it takes the command arguments as arguments one by one, in QAPI schema
@@ -660,10 +666,10 @@ for a command. We don't currently have a use case for both together and
660666without a use case, it's not entirely clear what the semantics should
661667be.
662668
663- The optional 'if' member specifies a conditional. See " Configuring
664- the schema" below for more on this.
669+ The optional 'if' member specifies a conditional. See ` Configuring
670+ the schema `_ below for more on this.
665671
666- The optional 'features' member specifies features. See "Features"
672+ The optional 'features' member specifies features. See Features _
667673below for more on this.
668674
669675
@@ -708,15 +714,17 @@ Resulting in this JSON object::
708714The generator emits a function to send the event. When member 'boxed'
709715is absent, it takes event-specific data one by one, in QAPI schema
710716order. Else it takes them wrapped in the C struct generated for the
711- complex type. See section " Code generated for events" for examples.
717+ complex type. See section ` Code generated for events `_ for examples.
712718
713- The optional 'if' member specifies a conditional. See " Configuring
714- the schema" below for more on this.
719+ The optional 'if' member specifies a conditional. See ` Configuring
720+ the schema `_ below for more on this.
715721
716- The optional 'features' member specifies features. See "Features"
722+ The optional 'features' member specifies features. See Features _
717723below for more on this.
718724
719725
726+ .. _FEATURE :
727+
720728Features
721729--------
722730
@@ -735,8 +743,8 @@ For this purpose, a list of features can be specified for a command or
735743struct type. Each list member can either be ``{ 'name': STRING, '*if':
736744COND } ``, or STRING, which is shorthand for ``{ 'name': STRING } ``.
737745
738- The optional 'if' member specifies a conditional. See " Configuring
739- the schema" below for more on this.
746+ The optional 'if' member specifies a conditional. See ` Configuring
747+ the schema `_ below for more on this.
740748
741749Example::
742750
@@ -745,7 +753,7 @@ Example::
745753 'features': [ 'allow-negative-numbers' ] }
746754
747755The feature strings are exposed to clients in introspection, as
748- explained in section " Client JSON Protocol introspection" .
756+ explained in section ` Client JSON Protocol introspection `_ .
749757
750758Intended use is to have each feature string signal that this build of
751759QEMU shows a certain behaviour.
@@ -764,7 +772,7 @@ Naming rules and reserved names
764772All names must begin with a letter, and contain only ASCII letters,
765773digits, hyphen, and underscore. There are two exceptions: enum values
766774may start with a digit, and names that are downstream extensions (see
767- section Downstream extensions) start with underscore.
775+ section ` Downstream extensions `_ ) start with underscore.
768776
769777Names beginning with ``q_ `` are reserved for the generator, which uses
770778them for munging QMP names that resemble C keywords or other
@@ -794,8 +802,9 @@ Any name (command, event, type, member, or enum value) beginning with
794802``x- `` is marked experimental, and may be withdrawn or changed
795803incompatibly in a future release.
796804
797- Pragmas ``command-name-exceptions `` and ``member-name-exceptions `` let you
798- violate naming rules. Use for new code is strongly discouraged.
805+ Pragmas ``command-name-exceptions `` and ``member-name-exceptions `` let
806+ you violate naming rules. Use for new code is strongly discouraged. See
807+ `Pragma directives `_ for details.
799808
800809
801810Downstream extensions
@@ -851,7 +860,7 @@ member 'bar' ::
851860A union's discriminator may not be conditional.
852861
853862Likewise, individual enumeration values be conditional. This requires
854- the longhand form of ENUM-VALUE .
863+ the longhand form of ENUM-VALUE _ .
855864
856865Example: an enum type with unconditional value 'foo' and conditional
857866value 'bar' ::
@@ -861,7 +870,7 @@ value 'bar' ::
861870 { 'name' : 'bar', 'if': 'defined(IFCOND)' } ] }
862871
863872Likewise, features can be conditional. This requires the longhand
864- form of FEATURE .
873+ form of FEATURE _ .
865874
866875Example: a struct with conditional feature 'allow-negative-numbers' ::
867876
@@ -893,7 +902,7 @@ If the documentation comment starts like ::
893902it documents the definition of SYMBOL, else it's free-form
894903documentation.
895904
896- See below for more on definition documentation.
905+ See below for more on ` Definition documentation`_ .
897906
898907Free-form documentation may be used to provide additional text and
899908structuring content.
@@ -984,7 +993,7 @@ Definition documentation
984993Definition documentation, if present, must immediately precede the
985994definition it documents.
986995
987- When documentation is required (see pragma 'doc-required'), every
996+ When documentation is required (see pragma _ 'doc-required'), every
988997definition must have documentation.
989998
990999Definition documentation starts with a line naming the definition,
@@ -1181,7 +1190,7 @@ the wire then.
11811190Each command or event defined with 'data' as MEMBERS object in the
11821191QAPI schema implicitly defines an object type.
11831192
1184- Example: the SchemaInfo for EVENT_C from section Events ::
1193+ Example: the SchemaInfo for EVENT_C from section Events _ ::
11851194
11861195 { "name": "EVENT_C", "meta-type": "event",
11871196 "arg-type": "q_obj-EVENT_C-arg" }
@@ -1205,7 +1214,7 @@ extensions. The "members" array is in no particular order; clients
12051214must search the entire object when learning whether a particular
12061215member is supported.
12071216
1208- Example: the SchemaInfo for MyType from section Struct types ::
1217+ Example: the SchemaInfo for MyType from section ` Struct types `_ ::
12091218
12101219 { "name": "MyType", "meta-type": "object",
12111220 "members": [
@@ -1216,7 +1225,7 @@ Example: the SchemaInfo for MyType from section Struct types ::
12161225"features" exposes the command's feature strings as a JSON array of
12171226strings.
12181227
1219- Example: the SchemaInfo for TestType from section Features ::
1228+ Example: the SchemaInfo for TestType from section Features _ ::
12201229
12211230 { "name": "TestType", "meta-type": "object",
12221231 "members": [
@@ -1232,7 +1241,7 @@ that provides the variant members for this type tag value). The
12321241list cases in the same order as the corresponding "tag" enum type.
12331242
12341243Example: the SchemaInfo for flat union BlockdevOptions from section
1235- Union types ::
1244+ ` Union types `_ ::
12361245
12371246 { "name": "BlockdevOptions", "meta-type": "object",
12381247 "members": [
@@ -1247,13 +1256,13 @@ Note that base types are "flattened": its members are included in the
12471256"members" array.
12481257
12491258A simple union implicitly defines an enumeration type for its implicit
1250- discriminator (called "type" on the wire, see section Union types).
1259+ discriminator (called "type" on the wire, see section ` Union types `_ ).
12511260
12521261A simple union implicitly defines an object type for each of its
12531262variants.
12541263
12551264Example: the SchemaInfo for simple union BlockdevOptionsSimple from section
1256- Union types ::
1265+ ` Union types `_ ::
12571266
12581267 { "name": "BlockdevOptionsSimple", "meta-type": "object",
12591268 "members": [
@@ -1273,7 +1282,7 @@ a JSON object with member "type", which names a type. Values of the
12731282alternate type conform to exactly one of its member types. There is
12741283no guarantee on the order in which "members" will be listed.
12751284
1276- Example: the SchemaInfo for BlockdevRef from section Alternate types ::
1285+ Example: the SchemaInfo for BlockdevRef from section ` Alternate types `_ ::
12771286
12781287 { "name": "BlockdevRef", "meta-type": "alternate",
12791288 "members": [
@@ -1297,13 +1306,13 @@ variant member "values". The values are listed in no particular
12971306order; clients must search the entire enum when learning whether a
12981307particular value is supported.
12991308
1300- Example: the SchemaInfo for MyEnum from section Enumeration types ::
1309+ Example: the SchemaInfo for MyEnum from section ` Enumeration types `_ ::
13011310
13021311 { "name": "MyEnum", "meta-type": "enum",
13031312 "values": [ "value1", "value2", "value3" ] }
13041313
13051314The SchemaInfo for a built-in type has the same name as the type in
1306- the QAPI schema (see section Built-in Types), with one exception
1315+ the QAPI schema (see section ` Built-in Types `_ ), with one exception
13071316detailed below. It has variant member "json-type" that shows how
13081317values of this type are encoded on the wire.
13091318
@@ -1505,7 +1514,7 @@ Example::
15051514
15061515 [Uninteresting stuff omitted...]
15071516
1508- For a modular QAPI schema (see section Include directives), code for
1517+ For a modular QAPI schema (see section ` Include directives `_ ), code for
15091518each sub-module SUBDIR/SUBMODULE.json is actually generated into ::
15101519
15111520 SUBDIR/$(prefix)qapi-types-SUBMODULE.h
@@ -1643,7 +1652,7 @@ Example::
16431652
16441653 [Uninteresting stuff omitted...]
16451654
1646- For a modular QAPI schema (see section Include directives), code for
1655+ For a modular QAPI schema (see section ` Include directives `_ ), code for
16471656each sub-module SUBDIR/SUBMODULE.json is actually generated into ::
16481657
16491658 SUBDIR/$(prefix)qapi-visit-SUBMODULE.h
@@ -1773,7 +1782,7 @@ Example::
17731782 }
17741783 [Uninteresting stuff omitted...]
17751784
1776- For a modular QAPI schema (see section Include directives), code for
1785+ For a modular QAPI schema (see section ` Include directives `_ ), code for
17771786each sub-module SUBDIR/SUBMODULE.json is actually generated into::
17781787
17791788 SUBDIR/$(prefix)qapi-commands-SUBMODULE.h
@@ -1862,7 +1871,7 @@ Example::
18621871
18631872 [Uninteresting stuff omitted...]
18641873
1865- For a modular QAPI schema (see section Include directives), code for
1874+ For a modular QAPI schema (see section ` Include directives `_ ), code for
18661875each sub-module SUBDIR/SUBMODULE.json is actually generated into ::
18671876
18681877 SUBDIR/$(prefix)qapi-events-SUBMODULE.h
0 commit comments