1. 16 3月, 2017 2 次提交
    • M
      qapi: Have each QAPI schema declare its returns white-list · 1554a8fa
      Markus Armbruster 提交于
      qapi.py has a hardcoded white-list of command names that may violate
      the rules on permitted return types.  Add a new pragma directive
      'returns-whitelist', and use it to replace the hard-coded white-list.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1489582656-31133-6-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      1554a8fa
    • 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
  2. 07 3月, 2017 3 次提交
    • M
      test-qapi-util: New, covering qapi/qapi-util.c · 6c873d11
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-Id: <1488317230-26248-18-git-send-email-armbru@redhat.com>
      6c873d11
    • M
      keyval: New keyval_parse() · d454dbe0
      Markus Armbruster 提交于
      keyval_parse() parses KEY=VALUE,... into a QDict.  Works like
      qemu_opts_parse(), except:
      
      * Returns a QDict instead of a QemuOpts (d'oh).
      
      * Supports nesting, unlike QemuOpts: a KEY is split into key
        fragments at '.' (dotted key convention; the block layer does
        something similar on top of QemuOpts).  The key fragments are QDict
        keys, and the last one's value is updated to VALUE.
      
      * Each key fragment may be up to 127 bytes long.  qemu_opts_parse()
        limits the entire key to 127 bytes.
      
      * Overlong key fragments are rejected.  qemu_opts_parse() silently
        truncates them.
      
      * Empty key fragments are rejected.  qemu_opts_parse() happily
        accepts empty keys.
      
      * It does not store the returned value.  qemu_opts_parse() stores it
        in the QemuOptsList.
      
      * It does not treat parameter "id" specially.  qemu_opts_parse()
        ignores all but the first "id", and fails when its value isn't
        id_wellformed(), or duplicate (a QemuOpts with the same ID is
        already stored).  It also screws up when a value contains ",id=".
      
      * Implied value is not supported.  qemu_opts_parse() desugars "foo" to
        "foo=on", and "nofoo" to "foo=off".
      
      * An implied key's value can't be empty, and can't contain ','.
      
      I intend to grow this into a saner replacement for QemuOpts.  It'll
      take time, though.
      
      Note: keyval_parse() provides no way to do lists, and its key syntax
      is incompatible with the __RFQDN_ prefix convention for downstream
      extensions, because it blindly splits at '.', even in __RFQDN_.  Both
      issues will be addressed later in the series.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488317230-26248-4-git-send-email-armbru@redhat.com>
      d454dbe0
    • M
      tests: Fix gcov-files-test-qemu-opts-y, gcov-files-test-logging-y · 112c9446
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NKevin Wolf <kwolf@redhat.com>
      Message-Id: <1488317230-26248-3-git-send-email-armbru@redhat.com>
      112c9446
  3. 05 3月, 2017 2 次提交
    • M
      tests-qobject-input-strict: Merge into test-qobject-input-visitor · 77c47de2
      Markus Armbruster 提交于
      Much of test-qobject-input-strict.c duplicates
      test-qobject-input-strict.c, but with less assertions on expected
      output:
      
      * test_validate_struct() duplicates test_visitor_in_struct()
      
      * test_validate_struct_nested() duplicates
        test_visitor_in_struct_nested()
      
      * test_validate_list() duplicates the first half of
        test_visitor_in_list()
      
      * test_validate_union_native_list() duplicates
        test_visitor_in_native_list_int()
      
      * test_validate_union_flat() duplicates test_visitor_in_union_flat()
      
      * test_validate_alternate() duplicates the first part of
        test_visitor_in_alternate()
      
      Merge the remaining test cases into test-qobject-input-visitor.c, and
      drop the now redundant test-qobject-input-strict.c.
      
      Test case "/visitor/input-strict/fail/list" isn't really about lists,
      it's about a bad struct nested in a list.  Rename accordingly.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-21-git-send-email-armbru@redhat.com>
      77c47de2
    • M
      qmp-test: New, covering basic QMP protocol · f66e7ac8
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-4-git-send-email-armbru@redhat.com>
      f66e7ac8
  4. 02 3月, 2017 1 次提交
  5. 28 2月, 2017 1 次提交
  6. 21 2月, 2017 2 次提交
    • P
      aio: introduce aio_co_schedule and aio_co_wake · 0c330a73
      Paolo Bonzini 提交于
      aio_co_wake provides the infrastructure to start a coroutine on a "home"
      AioContext.  It will be used by CoMutex and CoQueue, so that coroutines
      don't jump from one context to another when they go to sleep on a
      mutex or waitqueue.  However, it can also be used as a more efficient
      alternative to one-shot bottom halves, and saves the effort of tracking
      which AioContext a coroutine is running on.
      
      aio_co_schedule is the part of aio_co_wake that starts a coroutine
      on a remove AioContext, but it is also useful to implement e.g.
      bdrv_set_aio_context callbacks.
      
      The implementation of aio_co_schedule is based on a lock-free
      multiple-producer, single-consumer queue.  The multiple producers use
      cmpxchg to add to a LIFO stack.  The consumer (a per-AioContext bottom
      half) grabs all items added so far, inverts the list to make it FIFO,
      and goes through it one item at a time until it's empty.  The data
      structure was inspired by OSv, which uses it in the very code we'll
      "port" to QEMU for the thread-safe CoMutex.
      
      Most of the new code is really tests.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 20170213135235.12274-3-pbonzini@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0c330a73
    • P
      block: move AioContext, QEMUTimer, main-loop to libqemuutil · c2b38b27
      Paolo Bonzini 提交于
      AioContext is fairly self contained, the only dependency is QEMUTimer but
      that in turn doesn't need anything else.  So move them out of block-obj-y
      to avoid introducing a dependency from io/ to block-obj-y.
      
      main-loop and its dependency iohandler also need to be moved, because
      later in this series io/ will call iohandler_get_aio_context.
      
      [Changed copyright "the QEMU team" to "other QEMU contributors" as
      suggested by Daniel Berrange and agreed by Paolo.
      --Stefan]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Message-id: 20170213135235.12274-2-pbonzini@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      c2b38b27
  7. 01 2月, 2017 2 次提交
  8. 31 1月, 2017 5 次提交
  9. 28 1月, 2017 1 次提交
    • M
      tests: fix linking test-char on win32 · 7a008751
      Marc-André Lureau 提交于
      test.char.exe fails to link:
      qemu-char.o: In function `win_chr_free':
      /home/elmarco/src/qemu/qemu-char.c:2149: undefined reference to `qemu_del_polling_cb'
      /home/elmarco/src/qemu/qemu-char.c:2151: undefined reference to `qemu_del_polling_cb'
      qemu-char.o: In function `win_stdio_thread':
      /home/elmarco/src/qemu/qemu-char.c:2568: undefined reference to `qemu_del_wait_object'
      qemu-char.o: In function `qemu_chr_open_stdio':
      /home/elmarco/src/qemu/qemu-char.c:2661: undefined reference to `qemu_add_wait_object'
      /home/elmarco/src/qemu/qemu-char.c:2646: undefined reference to
      `qemu_add_wait_object'
      ...
      
      It needs main-loop.o symbols, among others. Linking with
      $(test-block-obj-y) brings what's necessary. We could try to eventually
      strip to the minimum if needed.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7a008751
  10. 17 1月, 2017 1 次提交
  11. 16 1月, 2017 1 次提交
    • M
      qapi: add qapi2texi script · 3313b612
      Marc-André Lureau 提交于
      As the name suggests, the qapi2texi script converts JSON QAPI
      description into a texi file suitable for different target
      formats (info/man/txt/pdf/html...).
      
      It parses the following kind of blocks:
      
      Free-form:
      
        ##
        # = Section
        # == Subsection
        #
        # Some text foo with *emphasis*
        # 1. with a list
        # 2. like that
        #
        # And some code:
        # | $ echo foo
        # | -> do this
        # | <- get that
        #
        ##
      
      Symbol description:
      
        ##
        # @symbol:
        #
        # Symbol body ditto ergo sum. Foo bar
        # baz ding.
        #
        # @param1: the frob to frobnicate
        # @param2: #optional how hard to frobnicate
        #
        # Returns: the frobnicated frob.
        #          If frob isn't frobnicatable, GenericError.
        #
        # Since: version
        # Notes: notes, comments can have
        #        - itemized list
        #        - like this
        #
        # Example:
        #
        # -> { "execute": "quit" }
        # <- { "return": {} }
        #
        ##
      
      That's roughly following the following EBNF grammar:
      
      api_comment = "##\n" comment "##\n"
      comment = freeform_comment | symbol_comment
      freeform_comment = { "# " text "\n" | "#\n" }
      symbol_comment = "# @" name ":\n" { member | tag_section | freeform_comment }
      member = "# @" name ':' [ text ] "\n" freeform_comment
      tag_section = "# " ( "Returns:", "Since:", "Note:", "Notes:", "Example:", "Examples:" ) [ text ]  "\n" freeform_comment
      text = free text with markup
      
      Note that the grammar is ambiguous: a line "# @foo:\n" can be parsed
      both as freeform_comment and as symbol_comment.  The actual parser
      recognizes symbol_comment.
      
      See docs/qapi-code-gen.txt for more details.
      
      Deficiencies and limitations:
      - the generated QMP documentation includes internal types
      - union type support is lacking
      - type information is lacking in generated documentation
      - doc comment error message positions are imprecise, they point
        to the beginning of the comment.
      - a few minor issues, all marked TODO/FIXME in the code
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20170113144135.5150-16-marcandre.lureau@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [test-qapi.py tweaked to avoid trailing empty lines in .out]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      3313b612
  12. 11 1月, 2017 1 次提交
  13. 22 12月, 2016 1 次提交
  14. 16 12月, 2016 1 次提交
  15. 15 11月, 2016 1 次提交
  16. 28 10月, 2016 2 次提交
  17. 26 10月, 2016 1 次提交
    • E
      tests: add atomic_add-bench · 070e3edc
      Emilio G. Cota 提交于
      With this microbenchmark we can measure the overhead of emulating atomic
      instructions with a configurable degree of contention.
      
      The benchmark spawns $n threads, each performing $o atomic ops (additions)
      in a loop. Each atomic operation is performed on a different cache line
      (assuming lines are 64b long) that is randomly selected from a range [0, $r).
      
      [ Note: each $foo corresponds to a -foo flag ]
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      Message-Id: <1467054136-10430-20-git-send-email-cota@braap.org>
      070e3edc
  18. 25 10月, 2016 2 次提交
  19. 24 10月, 2016 2 次提交
  20. 18 10月, 2016 2 次提交
  21. 06 10月, 2016 3 次提交
    • P
      rules.mak: quiet-command: Split command name and args to print · 0bdb12c7
      Peter Maydell 提交于
      The quiet-command make rule currently takes two arguments:
      the command and arguments to run, and a string to print if
      the V flag is not set (ie we are not being verbose).
      By convention, the string printed is of the form
      "  NAME   some args". Unfortunately to get nicely lined up
      output all the strings have to agree about what column the
      arguments should start in, which means that if we add a
      new quiet-command usage which wants a slightly longer CMD
      name then we either put up with misalignment or change
      every quiet-command string.
      
      Split the quiet-mode string into two, the "NAME" and
      the "same args" part, and use printf(1) to format the
      string automatically. This means we only need to change
      one place if we want to support a longer maximum name.
      
      In particular, we can now print 7-character names lined
      up properly (they are needed for the OSX "SETTOOL" invocation).
      
      Change all the uses of quiet-command to the new syntax.
      (Any which are missed or inadvertently reintroduced
      via later merges will result in slightly misformatted
      quiet output rather than disaster.)
      
      A few places in the pc-bios/ makefiles are updated to use
      "BUILD", "SIGN" and "STRIP" rather than "Building",
      "Signing" and "Stripping" for consistency and to keep them
      below 7 characters. Module .mo links now print "LD" rather
      than the nonstandard "LD -r".
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-id: 1475598441-27908-1-git-send-email-peter.maydell@linaro.org
      0bdb12c7
    • L
      aa9026fd
    • L
      libqos: add PPC64 PCI support · cf716b31
      Laurent Vivier 提交于
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      [dwg: Fixed build problem on 32-bit hosts]
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      cf716b31
  22. 05 10月, 2016 1 次提交
  23. 28 9月, 2016 1 次提交
  24. 23 9月, 2016 1 次提交