1. 05 3月, 2016 3 次提交
    • E
      qapi: Rename 'fields' to 'members' in generator · 14f00c6c
      Eric Blake 提交于
      C types and JSON objects don't have fields, but members.  We
      shouldn't gratuitously invent terminology.  This patch is a
      strict renaming of generator code internals (including testsuite
      comments), before later patches rename C interfaces.
      
      No change to generated code with this patch.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1457021813-10704-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      14f00c6c
    • E
      qapi-dealloc: Reduce use outside of generated code · 96a1616c
      Eric Blake 提交于
      No need to roll our own use of the dealloc visitors when we can
      just directly use the qapi_free_FOO() functions that do what we
      want in one line.
      
      In net.c, inline net_visit() into its remaining lone caller.
      
      After this patch, test-visitor-serialization.c is the only
      non-generated file that needs to use a dealloc visitor, because
      it is testing low level aspects of the visitor interface.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1456262075-3311-2-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      96a1616c
    • D
      qmp-shell: fix pretty printing of JSON responses · e55250c6
      Daniel P. Berrange 提交于
      Pretty printing of JSON responses is important to be able to understand
      large responses from query commands in particular. Unfortunately this
      was broken during the addition of the verbose flag in
      
        commit 1ceca07e
        Author: John Snow <jsnow@redhat.com>
        Date:   Wed Apr 29 15:14:04 2015 -0400
      
          scripts: qmp-shell: Add verbose flag
      
      This is because that change turned the python data structure into a
      formatted JSON string before the pretty print was given it. So we're
      just pretty printing a string, which is a no-op.
      
      The original pretty printer would output python objects.
      
      (QEMU) query-chardev
      {   u'return': [   {   u'filename': u'vc',
                             u'frontend-open': False,
                             u'label': u'parallel0'},
                         {   u'filename': u'vc',
                             u'frontend-open': True,
                             u'label': u'serial0'},
                         {   u'filename': u'unix:/tmp/qemp,server',
                             u'frontend-open': True,
                             u'label': u'compat_monitor0'}]}
      
      This fixes the problem by switching to outputting pretty formatted JSON
      text instead. This has the added benefit that the pretty printed output
      is now valid JSON text. Due to the way the verbose flag was handled, the
      pretty printing now applies to the command sent, as well as its response:
      
      (QEMU) query-chardev
      {
          "execute": "query-chardev",
          "arguments": {}
      }
      {
          "return": [
              {
                  "frontend-open": false,
                  "label": "parallel0",
                  "filename": "vc"
              },
              {
                  "frontend-open": true,
                  "label": "serial0",
                  "filename": "vc"
              },
              {
                  "frontend-open": true,
                  "label": "compat_monitor0",
                  "filename": "unix:/tmp/qmp,server"
              }
          ]
      }
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <1456224706-1591-1-git-send-email-berrange@redhat.com>
      Tested-by: NKashyap Chamarthy <kchamart@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      [Bonus fix: multiple -p now work]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      e55250c6
  2. 04 3月, 2016 31 次提交
  3. 03 3月, 2016 6 次提交