John Snow <[email protected]> writes:

> These are either structs or unions that are used in an inlinable
> context: i.e. the generated documentation is likely to feature a
> version of this documentation block that does not include the intro in
> context of another command, event, or structure.
>
> Signed-off-by: John Snow <[email protected]>
> ---
>  qapi/block-core.json | 45 +++++++++++++++++++-------------------------
>  1 file changed, 19 insertions(+), 26 deletions(-)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 1ca147285e7..88218e38d02 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -4462,9 +4462,8 @@
>  
>  ##
>  # @BlockdevOptionsCurlHttp:
> -#
> -# Driver specific block device options for HTTP connections over the
> -# curl backend.  URLs must start with "http://";.
> +#     Driver specific block device options for HTTP connections over
> +#     the curl backend.  URLs must start with "http://";.
>  #
>  # @cookie: List of cookies to set; format is "name1=content1;
>  #     name2=content2;" as explained by CURLOPT_COOKIE(3).  Defaults to

Not this patch's problem, but here goes anyway.

"URLs must start" applies to BlockdevOptionsCurlBase member @url.  We
should turn this into a proper link eventually.

Pattern: the base type's documentation needs to be amended somehow.
Here, we need to amend it to restrict the values os the base's member
@url.

This splits the documentation for @url.  Amendments are easy to miss.
At some point, we might want to think of ways to avoid this.

> @@ -4488,9 +4487,8 @@
>  
>  ##
>  # @BlockdevOptionsCurlHttps:
> -#
> -# Driver specific block device options for HTTPS connections over the
> -# curl backend.  URLs must start with "https://";.
> +#     Driver specific block device options for HTTPS connections over
> +#     the curl backend.  URLs must start with "https://";.
>  #
>  # @sslverify: Whether to verify the SSL certificate's validity
>  #     (defaults to true)
> @@ -4503,9 +4501,8 @@
>  
>  ##
>  # @BlockdevOptionsCurlFtp:
> -#
> -# Driver specific block device options for FTP connections over the
> -# curl backend.  URLs must start with "ftp://";.
> +#     Driver specific block device options for FTP connections over
> +#     the curl backend.  URLs must start with "ftp://";.
>  #
>  # Since: 2.9
>  ##
> @@ -4515,9 +4512,8 @@
>  
>  ##
>  # @BlockdevOptionsCurlFtps:
> -#
> -# Driver specific block device options for FTPS connections over the
> -# curl backend.  URLs must start with "ftps://".
> +#     Driver specific block device options for FTPS connections over
> +#     the curl backend.  URLs must start with "ftps://".
>  #
>  # @sslverify: Whether to verify the SSL certificate's validity
>  #     (defaults to true)
> @@ -4643,14 +4639,13 @@
>  
>  ##
>  # @BlockdevOptionsCbw:
> -#
> -# Driver specific block device options for the copy-before-write
> -# driver, which does so called copy-before-write operations: when data
> -# is written to the filter, the filter first reads corresponding
> -# blocks from its file child and copies them to @target child.  After
> -# successfully copying, the write request is propagated to file child.
> -# If copying fails, the original write request is failed too and no
> -# data is written to file child.
> +#     Driver specific block device options for the copy-before-write
> +#     driver, which does so called copy-before-write operations: when
> +#     data is written to the filter, the filter first reads
> +#     corresponding blocks from its file child and copies them to
> +#     @target child.  After successfully copying, the write request is
> +#     propagated to file child.  If copying fails, the original write
> +#     request is failed too and no data is written to file child.
>  #
>  # @target: The target for copy-before-write operations.
>  #
> @@ -4686,9 +4681,8 @@
>  
>  ##
>  # @BlockdevOptions:
> -#
> -# Options for creating a block device.  Many options are available for
> -# all block devices, independent of the block driver:
> +#     Options for creating a block device.  Many options are available
> +#     for all block devices, independent of the block driver:

Intro ends with colon, which is unusual, and doesn't really work with
the way documentation gets rendered:

   Options for creating a block device.  Many options are available
   for all block devices, independent of the block driver:

   Members:
      * driver ("BlockdevDriver") -- block driver name

      [More non-variant members...]

      * force-share ("boolean", *optional*) -- force share all
        permission on added nodes.  Requires read-only=true.  (Since
        2.10)

      * When "driver" is "blkdebug": The members of
        "BlockdevOptionsBlkdebug".

      [More variants...]

>  #
>  # @driver: block driver name
>  #
> @@ -5473,9 +5467,8 @@
>  
>  ##
>  # @BlockdevAmendOptionsQcow2:
> -#
> -# Driver specific image amend options for qcow2.  For now, only
> -# encryption options can be amended
> +#     Driver specific image amend options for qcow2.  For now, only
> +#     encryption options can be amended

The second sentence lacks a period.

Let's leave both of these for another day, just take note of future
work:

7. Clean up intros to consist of sentences.  Sentences start with a
capital letter and end with a period.

>  #
>  # @encrypt: Encryption options to be amended
>  #


Reply via email to