1. 09 2月, 2018 2 次提交
  2. 04 9月, 2017 1 次提交
  3. 09 5月, 2017 1 次提交
  4. 05 3月, 2017 4 次提交
    • M
      qmp: Eliminate silly QERR_QMP_* macros · 99fb0c53
      Markus Armbruster 提交于
      The QERR_ macros are leftovers from the days of "rich" error objects.
      
      QERR_QMP_BAD_INPUT_OBJECT, QERR_QMP_BAD_INPUT_OBJECT_MEMBER,
      QERR_QMP_EXTRA_MEMBER are used in just one place now, except for one
      use that has crept into qobject-input-visitor.c.
      
      Drop these macros, to make the (bad) error messages more visible.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-10-git-send-email-armbru@redhat.com>
      99fb0c53
    • M
      qmp: Drop duplicated QMP command object checks · 104fc302
      Markus Armbruster 提交于
      qmp_check_input_obj() duplicates qmp_dispatch_check_obj(), except the
      latter screws up an error message.  handle_qmp_command() runs first
      the former, then the latter via qmp_dispatch(), masking the screwup.
      
      qemu-ga also masks the screwup, because it also duplicates checks,
      just differently.
      
      qmp_check_input_obj() exists because handle_qmp_command() needs to
      examine the command before dispatching it.  The previous commit got
      rid of this need, except for a tracepoint, and a bit of "id" code that
      relies on qdict not being null.
      
      Fix up the error message in qmp_dispatch_check_obj(), drop
      qmp_check_input_obj() and the tracepoint.  Protect the "id" code with
      a conditional.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-9-git-send-email-armbru@redhat.com>
      104fc302
    • M
      qapi: Support multiple command registries per program · 1527badb
      Markus Armbruster 提交于
      The command registry encapsulates a single command list.  Give the
      functions using it a parameter instead.  Define suitable command lists
      in monitor, guest agent and test-qmp-commands.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-6-git-send-email-armbru@redhat.com>
      [Debugging turds buried]
      Reviewed-by: NEric Blake <eblake@redhat.com>
      1527badb
    • M
      qga: Fix crash on non-dictionary QMP argument · 74d8c9d9
      Markus Armbruster 提交于
      The value of key 'arguments' must be a JSON object.  qemu-ga neglects
      to check, and crashes.  To reproduce, send
      
          { 'execute': 'guest-sync', 'arguments': [] }
      
      to qemu-ga.
      
      do_qmp_dispatch() uses qdict_get_qdict() to get the arguments.  When
      not a JSON object, this gets a null pointer, which flows through the
      generated marshalling function to qobject_input_visitor_new(), where
      it fails the assertion.  qmp_dispatch_check_obj() needs to catch this
      error.
      
      QEMU isn't affected, because it runs qmp_check_input_obj() first,
      which basically duplicates qmp_dispatch_check_obj()'s checks, plus the
      missing one.
      
      Fix by copying the missing one from qmp_check_input_obj() to
      qmp_dispatch_check_obj().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-2-git-send-email-armbru@redhat.com>
      74d8c9d9
  5. 23 2月, 2017 1 次提交
  6. 06 7月, 2016 1 次提交
  7. 12 5月, 2016 1 次提交
  8. 23 3月, 2016 1 次提交
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  9. 05 2月, 2016 1 次提交
  10. 17 12月, 2015 1 次提交
    • E
      qapi: Add alias for ErrorClass · f22a28b8
      Eric Blake 提交于
      The qapi enum ErrorClass is unusual that it uses 'CamelCase' names,
      contrary to our documented convention of preferring 'lower-case'.
      However, this enum is entrenched in the API; we cannot change
      what strings QMP outputs.  Meanwhile, we want to simplify how
      c_enum_const() is used to generate enum constants, by moving away
      from the heuristics of camel_to_upper() to a more straightforward
      c_name(N).upper() - but doing so will rename all of the ErrorClass
      constants and cause churn to all client files, where the new names
      are aesthetically less pleasing (ERROR_CLASS_DEVICENOTFOUND looks
      like we can't make up our minds on whether to break between words).
      
      So as always in computer science, solve the problem by some more
      indirection: rename the qapi type to QapiErrorClass, and add a
      new enum ErrorClass in error.h whose members are aliases of the
      qapi type, but with the spelling expected elsewhere in the tree.
      Then, when c_enum_const() changes the munging, we only have to
      adjust the one alias spot.
      
      Suggested by: Markus Armbruster <armbru@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1447836791-369-26-git-send-email-eblake@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      f22a28b8
  11. 23 6月, 2015 1 次提交
  12. 29 1月, 2015 1 次提交
  13. 09 5月, 2014 3 次提交
  14. 25 4月, 2014 1 次提交
  15. 19 12月, 2012 1 次提交
  16. 14 8月, 2012 2 次提交
  17. 15 5月, 2012 1 次提交
  18. 13 12月, 2011 1 次提交
  19. 22 7月, 2011 1 次提交