1. 10 3月, 2017 1 次提交
  2. 07 3月, 2017 16 次提交
  3. 06 3月, 2017 1 次提交
  4. 05 3月, 2017 15 次提交
    • M
      qapi: Fix object input visit beyond end of list · 1f41a645
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-28-git-send-email-armbru@redhat.com>
      1f41a645
    • M
      tests: Cover input visit beyond end of list · a9416dc6
      Markus Armbruster 提交于
      When you try to visit beyond the end of a list, the qobject input
      visitor crashes, and the string visitor screws returns garbage.  The
      generated list visits never go beyond the list end, but manual visits
      could.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-27-git-send-email-armbru@redhat.com>
      a9416dc6
    • M
      qapi: Make input visitors detect unvisited list tails · a4a1c70d
      Markus Armbruster 提交于
      Fix the design flaw demonstrated in the previous commit: new method
      check_list() lets input visitors report that unvisited input remains
      for a list, exactly like check_struct() lets them report that
      unvisited input remains for a struct or union.
      
      Implement the method for the qobject input visitor (straightforward),
      and the string input visitor (less so, due to the magic list syntax
      there).  The opts visitor's list magic is even more impenetrable, and
      all I can do there today is a stub with a FIXME comment.  No worse
      than before.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-26-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      a4a1c70d
    • M
      test-qobject-input-visitor: Cover missing nested struct member · 86ca0dbe
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-25-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      86ca0dbe
    • M
      tests: Cover partial input visit of list · 9cb8ef36
      Markus Armbruster 提交于
      Demonstrates a design flaw: there is no way to for input visitors to
      report that a list visit didn't visit the complete input list.  The
      generated list visits always do, but manual visits needn't.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-24-git-send-email-armbru@redhat.com>
      9cb8ef36
    • M
      test-string-input-visitor: Improve list coverage · 3d089cea
      Markus Armbruster 提交于
      Lists with elements above INT64_MAX don't work (known bug).  Empty
      lists don't work (weird).
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-23-git-send-email-armbru@redhat.com>
      3d089cea
    • M
      test-string-input-visitor: Tear down existing test automatically · 0f721d16
      Markus Armbruster 提交于
      Call visitor_input_teardown() from visitor_input_test_init(), so you
      don't have to call it from the actual tests.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-22-git-send-email-armbru@redhat.com>
      0f721d16
    • 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
      qapi: Drop unused non-strict qobject input visitor · 048abb7b
      Markus Armbruster 提交于
      The split between tests/test-qobject-input-visitor.c and
      tests/test-qobject-input-strict.c now makes less sense than ever.  The
      next commit will take care of that.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-20-git-send-email-armbru@redhat.com>
      048abb7b
    • M
      test-qobject-input-visitor: Use strict visitor · ec95f614
      Markus Armbruster 提交于
      The qobject input visitor comes in a strict and a non-strict variant.
      This test is the non-strict variant's last user.  Turns out it relies
      on non-strict only in test_visitor_in_null(), and just out of
      laziness.  We don't actually test the non-strict behavior.
      
      Clean up test_visitor_in_null(), and switch to the strict variant.
      The next commit will drop the non-strict variant.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-19-git-send-email-armbru@redhat.com>
      ec95f614
    • M
      qapi: Improve a QObject input visitor error message · 910f738b
      Markus Armbruster 提交于
      The QObject input visitor has three error message formats:
      
      * Parameter '%s' is missing
      * "Invalid parameter type for '%s', expected: %s"
      * "QMP input object member '%s' is unexpected"
      
      The '%s' are member names (or "null", but I'll fix that later).
      
      The last error message calls the thing "QMP input object member"
      instead of "parameter".  Misleading when the visitor is used on
      QObjects that don't come from QMP.  Change it to "Parameter '%s' is
      unexpected".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-12-git-send-email-armbru@redhat.com>
      910f738b
    • 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
      qmp: Dumb down how we run QMP command registration · 05875687
      Markus Armbruster 提交于
      The way we get QMP commands registered is high tech:
      
      * qapi-commands.py generates qmp_init_marshal() that does the actual work
      
      * it also generates the magic to register it as a MODULE_INIT_QAPI
        function, so it runs when someone calls
        module_call_init(MODULE_INIT_QAPI)
      
      * main() calls module_call_init()
      
      QEMU needs to register a few non-qapified commands.  Same high tech
      works: monitor.c has its own qmp_init_marshal() along with the magic
      to make it run in module_call_init(MODULE_INIT_QAPI).
      
      QEMU also needs to unregister commands that are not wanted in this
      build's configuration (commit 5032a16d).  Simple enough:
      qmp_unregister_commands_hack().  The difficulty is to make it run
      after the generated qmp_init_marshal().  We can't simply run it in
      monitor.c's qmp_init_marshal(), because the order in which the
      registered functions run is indeterminate.  So qmp_init_marshal()
      registers qmp_unregister_commands_hack() separately.  Since
      registering *appends* to the list of registered functions, this will
      make it run after all the functions that have been registered already.
      
      I suspect it takes a long and expensive computer science education to
      not find this silly.
      
      Dumb it down as follows:
      
      * Drop MODULE_INIT_QAPI entirely
      
      * Give the generated qmp_init_marshal() external linkage.
      
      * Call it instead of module_call_init(MODULE_INIT_QAPI)
      
      * Except in QEMU proper, call new monitor_init_qmp_commands() that in
        turn calls the generated qmp_init_marshal(), registers the
        additional commands and unregisters the unwanted ones.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-5-git-send-email-armbru@redhat.com>
      05875687
    • 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
    • M
      libqtest: Work around a "QMP wants a newline" bug · 13420ef8
      Markus Armbruster 提交于
      The next commit is going to add a test that calls qmp("null").
      Curiously, this hangs.  Here's why.
      
      qmp_fd_sendv() doesn't send newlines.  Not even when @fmt contains
      some.  At first glance, the QMP parser seems to be fine with that.
      However, it turns out that it fails to react to input until it sees
      either a newline, an object or an array.  To reproduce, feed to a QMP
      monitor like this:
      
          $ echo -n 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
      
      No output after the greeting.
      
      Add a newline:
      
          $ echo 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
          {"error": {"class": "GenericError", "desc": "Expected 'object' in QMP input"}}
      
      Correct output for input 'null'.
      
      Add an object instead:
      
          $ echo -n 'null { "execute": "qmp_capabilities" }' | socat UNIX:qmp-socket STDIO
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
          {"error": {"class": "GenericError", "desc": "Expected 'object' in QMP input"}}
          {"return": {}}
      
      Also correct output.
      
      Work around this QMP bug by having qmp_fd_sendv() append a newline.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-3-git-send-email-armbru@redhat.com>
      13420ef8
  5. 03 3月, 2017 1 次提交
    • D
      powernv: Don't test POWER9 CPU yet · eaa477ca
      David Gibson 提交于
      A couple of tests for the work-in-progress 'powernv' machine type attempt
      to test on POWER9 CPUs.  However the POWER9 CPU support is incomplete and
      this doesn't really work.  In particular the firmware image we have
      currently assumes the presence of the SDR1 register, which no longer exists
      on POWER9.  We only got away with this so far, because of a different bug
      which added SDR1 to POWER9 even though it shouldn't be there.
      
      For now, remove POWER9 testing of powernv, POWER8 testing will do for now
      until the POWER9 support is more complete.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      eaa477ca
  6. 02 3月, 2017 2 次提交
  7. 01 3月, 2017 4 次提交