1. 14 12月, 2018 4 次提交
  2. 04 7月, 2018 2 次提交
  3. 31 5月, 2018 1 次提交
    • I
      qapi: introduce new cmd option "allow-preconfig" · d6fe3d02
      Igor Mammedov 提交于
      New option will be used to allow commands, which are prepared/need
      to run, during preconfig state. Other commands that should be able
      to run in preconfig state, should be amended to not expect machine
      in initialized state or deal with it.
      
      For compatibility reasons, commands that don't use new flag
      'allow-preconfig' explicitly are not permitted to run in
      preconfig state but allowed in all other states like they used
      to be.
      
      Within this patch allow following commands in preconfig state:
         qmp_capabilities
         query-qmp-schema
         query-commands
         query-command-line-options
         query-status
         exit-preconfig
      to allow qmp connection, basic introspection and moving to the next
      state.
      
      PS:
      set-numa-node and query-hotpluggable-cpus will be enabled later in
      a separate patches.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1526057503-39287-1-git-send-email-imammedo@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [ehabkost: Changed "since 2.13" to "since 3.0"]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d6fe3d02
  4. 20 3月, 2018 1 次提交
  5. 19 3月, 2018 1 次提交
  6. 03 3月, 2018 3 次提交
  7. 06 2月, 2018 2 次提交
  8. 21 12月, 2017 5 次提交
  9. 31 7月, 2017 1 次提交
  10. 21 3月, 2017 2 次提交
  11. 16 3月, 2017 18 次提交
    • M
      qapi2texi: Use category "Object" for all object types · 75b50196
      Markus Armbruster 提交于
      At the protocol level, the distinction between struct, flat union and
      simple union is meaningless, they are all JSON objects.  Document them
      that way.
      
      Example change (qemu-qmp-ref.txt):
      
      - -- Simple Union: InputEvent
      + -- Object: InputEvent
      
            Input event union.
      
      This also fixes the completely broken headings for flat and simple
      unions in qemu-qmp-ref.7 and qemu-ga-ref.7, by sidestepping a bug in
      texi2pod.pl.  For instance, it mistranslates "@deftp {Simple Union}
      InputEvent" to "B<Union> (Simple)", but translates "@deftp Object
      InputEvent" to "B<SocketAddress> (Object)".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-30-git-send-email-armbru@redhat.com>
      75b50196
    • M
      qapi2texi: Generate descriptions for simple union tags · c19eaa64
      Markus Armbruster 提交于
      Simple union tags carry no type information, because their type is
      implicit.  Their description should make up for it, but many have
      none.  Generate one automatically then.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Simple Union: ImageInfoSpecific
      
            A discriminated record of image format specific information
            structures.
      
            Members:
            'type'
      -          Not documented
      +          One of "qcow2", "vmdk", "luks"
            'data: ImageInfoSpecificQCow2' when 'type' is "qcow2"
            'data: ImageInfoSpecificVmdk' when 'type' is "vmdk"
            'data: QCryptoBlockInfoLUKS' when 'type' is "luks"
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-29-git-send-email-armbru@redhat.com>
      c19eaa64
    • M
      qapi2texi: Generate documentation for variant members · 5169cd87
      Markus Armbruster 提交于
      A flat union's branch brings in the members of another type.  Generate
      a suitable reference to that type.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Flat Union: QCryptoBlockOpenOptions
      
            The options that are available for all encryption formats when
            opening an existing volume
      
            Members:
            The members of 'QCryptoBlockOptionsBase'
      +     The members of 'QCryptoBlockOptionsQCow' when 'format' is "qcow"
      +     The members of 'QCryptoBlockOptionsLUKS' when 'format' is "luks"
      
            Since: 2.6
      
      A simple union's branch adds a member 'data' of some other type.
      Generate documentation for that member.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Simple Union: SocketAddress
      
            Captures the address of a socket, which could also be a named file
            descriptor
      
            Members:
            'type'
      	   Not documented
      +     'data: InetSocketAddress' when 'type' is "inet"
      +     'data: UnixSocketAddress' when 'type' is "unix"
      +     'data: VsockSocketAddress' when 'type' is "vsock"
      +     'data: String' when 'type' is "fd"
      
            Since: 1.3
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-28-git-send-email-armbru@redhat.com>
      5169cd87
    • M
      qapi2texi: Generate reference to base type members · 88f63467
      Markus Armbruster 提交于
      The generated documentation doesn't mention object type members
      inherited from a base type.  Fix that.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Struct: VncServerInfo
      
            The network connection information for server
      
            Members:
            'auth' (optional)
      	   authentication method used for the plain (non-websocket) VNC
      	   server
      +     The members of 'VncBasicInfo'
      
            Since: 2.1
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-27-git-send-email-armbru@redhat.com>
      88f63467
    • M
      qapi2texi: Include member type in generated documentation · 691e0313
      Markus Armbruster 提交于
      The recent merge of docs/qmp-commands.txt and docs/qmp-events.txt into
      the schema lost type information.  Fix this documentation regression.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Struct: InputKeyEvent
      
            Keyboard input event.
      
            Members:
      -     'button'
      +     'button: InputButton'
                 Which button this event is for.
      -     'down'
      +     'down: boolean'
                 True for key-down and false for key-up events.
      
            Since: 2.0
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-26-git-send-email-armbru@redhat.com>
      691e0313
    • M
      qapi2texi: Implement boxed argument documentation · c2dd311c
      Markus Armbruster 提交于
      This replaces manual references like "For the arguments, see the
      documentation of ..." by a generated reference "Arguments: the members
      of ...".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-25-git-send-email-armbru@redhat.com>
      c2dd311c
    • M
      qapi2texi: Don't hide undocumented members and arguments · 2c99f5fd
      Markus Armbruster 提交于
      Show undocumented object, alternate type members and command, event
      arguments exactly like undocumented enumeration type values.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Command: query-rocker
      
            Return rocker switch information.
      
      +     Arguments:
      +     'name'
      +          Not documented
      +
            Returns: 'Rocker' information
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-24-git-send-email-armbru@redhat.com>
      2c99f5fd
    • M
      qapi2texi: Explain enum value undocumentedness more clearly · 5da19f14
      Markus Armbruster 提交于
      Instead of not saying anything when we have no documentation, say "Not
      documented".
      
      Example change (qemu-qmp-ref.txt):
      
        -- Enum: GuestPanicAction
      
            An enumeration of the actions taken when guest OS panic is detected
      
            Values:
            'pause'
                 system pauses
            'poweroff'
      +          Not documented
      
            Since: 2.1 (poweroff since 2.8)
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-23-git-send-email-armbru@redhat.com>
      5da19f14
    • M
      qapi2texi: Present the table of members more clearly · 2a1183ce
      Markus Armbruster 提交于
      The table of members follows the main descriptive text immediately.
      Makes it hard to see what it is about.  Start a new paragraph, and
      lead with a line "Members:" for object and alternate types, "Values:"
      for enumeration types, and "Arguments:" for commands and events.
      
      Example change (qemu-qmp-ref.txt):
      
        -- Command: set_link
      
            Sets the link status of a virtual network adapter.
      +
      +     Arguments:
            'name'
                 the device name of the virtual network adapter
            'up'
                 true to set the link status to be up
      
            Returns: Nothing on success If 'name' is not a valid network
            device, DeviceNotFound
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-22-git-send-email-armbru@redhat.com>
      2a1183ce
    • M
      qapi2texi: Plainer enum value and member name formatting · 71d918a1
      Markus Armbruster 提交于
      Use @code{%s} instead of @code{'%s'}.  Impact, using @id as example:
      
      * Texinfo
        -@item @code{'id'}
        +@item @code{id}
      
      * HTML
        -<dt><code>'id'</code></dt>
        +<dt><code>id</code></dt>
      
      * POD (for manual pages):
        -=item C<'id'>
        +=item C<id>
      
      * Formatted manual pages:
        -'id'
        +"id"
      
      * Plain text:
        -     ''id''
        +     'id'
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-21-git-send-email-armbru@redhat.com>
      71d918a1
    • M
      qapi: Prefer single-quoted strings more consistently · ef801a9b
      Markus Armbruster 提交于
      PEP 8 advises:
      
          In Python, single-quoted strings and double-quoted strings are the
          same.  This PEP does not make a recommendation for this.  Pick a
          rule and stick to it.  When a string contains single or double
          quote characters, however, use the other one to avoid backslashes
          in the string.  It improves readability.
      
      The QAPI generators succeed at picking a rule, but fail at sticking to
      it.  Convert a bunch of double-quoted strings to single-quoted ones.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-20-git-send-email-armbru@redhat.com>
      ef801a9b
    • M
      qapi: The #optional tag is redundant, drop · 1d8bda12
      Markus Armbruster 提交于
      We traditionally mark optional members #optional in the doc comment.
      Before commit 3313b612, this was entirely manual.
      
      Commit 3313b612 added some automation because its qapi2texi.py relied
      on #optional to determine whether a member is optional.  This is no
      longer the case since the previous commit: the only thing qapi2texi.py
      still does with #optional is stripping it out.  We still reject bogus
      qapi-schema.json and six places for qga/qapi-schema.json.
      
      Thus, you can't actually rely on #optional to see whether something is
      optional.  Yet we still make people add it manually.  That's just
      busy-work.
      
      Drop the code to check, fix up and strip out #optional, along with all
      instances of #optional.  To keep it out, add code to reject it, to be
      dropped again once the dust settles.
      
      No change to generated documentation.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-18-git-send-email-armbru@redhat.com>
      1d8bda12
    • M
      qapi2texi: Convert to QAPISchemaVisitor · aa964b7f
      Markus Armbruster 提交于
      qapi2texi works with schema expression trees.  Such a tight coupling
      to schema language syntax is not a good idea.  Convert it to the visitor
      interface the other generators use.
      
      No change to generated documentation.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-17-git-send-email-armbru@redhat.com>
      aa964b7f
    • M
      qapi: Conjure up QAPIDoc.ArgSection for undocumented members · 860e8778
      Markus Armbruster 提交于
      qapi2texi.py already conjures up ArgSections for undocumented
      enumeration values, in texi_enum.  Drop that, and conjure them up for
      all kinds of "arguments" (enumeration values, object and alternate
      type members) in qapi.py instead.
      
      Take care to keep generated documentation exactly the same for now.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1489582656-31133-16-git-send-email-armbru@redhat.com>
      860e8778
    • M
      qapi: Avoid unwanted blank lines in QAPIDoc · b116fd8e
      Markus Armbruster 提交于
      We silently fix missing #optional tags for QAPIDoc by appending a line
      "#optional" to the section's .content.  However, this interferes with
      .__repr__ stripping trailing blank lines from .content.
      
      Use new ArgSection instance variable .optional instead, and leave
      .content alone.
      
      To permit testing .optional in texi_body(), clean up texi_enum()'s
      hack to add empty documentation for undocumented enum values: add an
      ArgSection instead of ''.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1489582656-31133-12-git-send-email-armbru@redhat.com>
      b116fd8e
    • M
      qapi2texi: Fix up output around #optional · 42bebcc1
      Markus Armbruster 提交于
      We use tag #optional to mark optional members, like this:
      
          # @name: #optional The name of the guest
      
      texi_body() strips #optional, but not whitespace around it.  For the
      above, we get in qemu-qmp-qapi.texi
      
          @item @code{'name'} (optional)
           The name of the guest
          @end table
      
      The extra space can lead to artifacts in output, e.g in
      qemu-qmp-ref.7.pod
      
          =item C<'name'> (optional)
      
           The name of the guest
      
      and then in qemu-qmp-ref.7
      
          .IX Item "name (optional)"
          .Vb 1
          \& The name of the guest
          .Ve
      
      instead of intended plain
      
          .IX Item "name (optional)"
          The name of the guest
      
      Get rid of these artifacts by removing whitespace around #optional
      along with it.
      
      This turns three minus signs in qapi-schema.json into markup, because
      they're now at the beginning of the line.  Drop them, they're unwanted
      there.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <1489582656-31133-11-git-send-email-armbru@redhat.com>
      42bebcc1
    • M
      qapi: Make doc comments optional where we don't need them · bc52d03f
      Markus Armbruster 提交于
      Since we added the documentation generator in commit 3313b612, doc
      comments are mandatory.  That's a very good idea for a schema that
      needs to be documented, but has proven to be annoying for testing.
      
      Make doc comments optional again, but add a new directive
      
          { 'pragma': { 'doc-required': true } }
      
      to let a QAPI schema require them.
      
      Add test cases for the new pragma directive.  While there, plug a
      minor hole in includ directive test coverage.
      
      Require documentation in the schemas we actually want documented:
      qapi-schema.json and qga/qapi-schema.json.
      
      We could probably make qapi2texi.py cope with incomplete
      documentation, but for now, simply make it refuse to run unless the
      schema has 'doc-required': true.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1489582656-31133-3-git-send-email-armbru@redhat.com>
      [qapi-code-gen.txt wording tweaked]
      Reviewed-by: NEric Blake <eblake@redhat.com>
      bc52d03f
    • M
      qapi2texi: change texi formatters · 597494ab
      Marc-André Lureau 提交于
      STRUCT_FMT is generic enough, rename it to TYPE_FMT, use it for unions.
      
      Rename COMMAND_FMT to MSG_FMT, since it applies to both commands and
      events.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20170125130308.16104-2-marcandre.lureau@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      597494ab