1. 04 7月, 2018 2 次提交
    • M
      tests/qmp-test: Test in-band command doesn't overtake · 2970b446
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180703085358.13941-7-armbru@redhat.com>
      2970b446
    • M
      qmp: Get rid of x-oob-test command · 97ca0712
      Markus Armbruster 提交于
      tests/qmp-test tests an out-of-band command overtaking a slow in-band
      command.  To do that, it needs:
      
      1. An in-band command that *reliably* takes long enough to be
         overtaken.
      
      2. An out-of-band command to do the overtaking.
      
      3. To avoid delays, a way to make the in-band command complete quickly
         after it was overtaken.
      
      To satisfy these needs, commit 469638f9 provides the rather
      peculiar oob-capable QMP command x-oob-test:
      
      * With "lock": true, it waits for a global semaphore.
      
      * With "lock": false, it signals the global semaphore.
      
      To satisfy 1., the test runs x-oob-test in-band with "lock": true.
      To satisfy 2. and 3., it runs x-oob-test out-of-band with "lock": false.
      
      Note that waiting for a semaphore violates the rules for oob-capable
      commands.  Running x-oob-test with "lock": true hangs the monitor
      until you run x-oob-test with "lock": false on another monitor (which
      you might not have set up).
      
      Having an externally visible QMP command that may hang the monitor is
      not nice.  Let's apply a little more ingenuity to the problem.  Idea:
      have an existing command block on reading a FIFO special file, unblock
      it by opening the FIFO for writing.
      
      For 1., use
      
          {"execute": "blockdev-add",  "id": ID1,
           "arguments": {
              "driver": "blkdebug", "node-name": ID1, "config": FIFO,
              "image": { "driver": "null-co"}}}
      
      where ID1 is an arbitrary string, and FIFO is the name of the FIFO.
      
      For 2., use
      
          {"execute": "migrate-pause", "id": ID2, "control": {"run-oob": true}}
      
      where ID2 is a different arbitrary string.  Since there's no migration
      to pause, the command will fail, but that's fine; instant failure is
      still a test of out-of-band responses overtaking in-band commands.
      
      For 3., open FIFO for writing.
      
      Drop QMP command x-oob-test.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180703085358.13941-6-armbru@redhat.com>
      [Error checking tweaked]
      97ca0712
  2. 03 7月, 2018 1 次提交
  3. 31 5月, 2018 2 次提交
  4. 04 5月, 2018 1 次提交
  5. 27 3月, 2018 3 次提交
  6. 24 3月, 2018 3 次提交
  7. 20 3月, 2018 3 次提交
    • P
      tests: qmp-test: add oob test · d003f7a8
      Peter Xu 提交于
      Test the new OOB capability.  Here we used the new "x-oob-test" command.
      First, we send a lock=true and oob=false command to hang the main
      thread.  Then send another lock=false and oob=true command (which will
      be run inside parser this time) to free that hanged command.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180309090006.10018-24-peterx@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [eblake: grammar tweaks]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d003f7a8
    • P
      tests: qmp-test: verify command batching · 91ad4506
      Peter Xu 提交于
      OOB introduced DROP event for flow control.  This should not affect old
      QMP clients.  Add a command batching check to make sure of it.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180309090006.10018-23-peterx@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      91ad4506
    • P
      qmp: introduce QMPCapability · 02130314
      Peter Xu 提交于
      There were no QMP capabilities defined.  Define the first capability,
      "oob", to allow out-of-band messages.
      
      After this patch, we will allow QMP clients to enable QMP capabilities
      when sending the first "qmp_capabilities" command.  Originally we are
      starting QMP session with no arguments like:
      
        { "execute": "qmp_capabilities" }
      
      Now we can enable some QMP capabilities using (take OOB as example,
      which is the only capability that we support):
      
        { "execute": "qmp_capabilities",
          "arguments": { "enable": [ "oob" ] } }
      
      When the "arguments" key is not provided, no capability is enabled.
      
      For capability "oob", the monitor needs to be run on a dedicated IO
      thread, otherwise the command will fail.  For example, trying to enable
      OOB on a MUXed typed QMP monitor will fail.
      
      One thing to mention is that QMP capabilities are per-monitor, and also
      when the connection is closed due to some reason, the capabilities will
      be reset.
      
      Also, touch up qmp-test.c to test the new bits.
      Signed-off-by: NPeter Xu <peterx@redhat.com>
      Message-Id: <20180309090006.10018-11-peterx@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [eblake: touch up commit message]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      02130314
  8. 14 3月, 2018 2 次提交
  9. 13 3月, 2018 1 次提交
  10. 03 3月, 2018 1 次提交
    • M
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster 提交于
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      everything.
      
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      possible.
      
      It's possible everywhere, except:
      
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      
      Perhaps we'll get rid of those some other day.
      
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      112ed241
  11. 14 2月, 2018 1 次提交
    • E
      qmp-test: Drop dependence on global_qtest · 6a5c88f5
      Eric Blake 提交于
      As a general rule, we prefer avoiding implicit global state
      because it makes code harder to safely copy and paste without
      thinking about the global state.  Although qmp-test does not
      maintain parallel qtest connections, it was the last test
      assigning to global_qtest.  It's just as easy to be explicit
      about the state; once all tests have been cleaned up, a later
      patch can then get rid of global_qtest and a layer of wrappers
      in libqtest.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      6a5c88f5
  12. 09 2月, 2018 2 次提交
  13. 16 1月, 2018 1 次提交
  14. 04 9月, 2017 3 次提交
    • M
      qapi: Change data type of the FOO_lookup generated for enum FOO · f7abe0ec
      Marc-André Lureau 提交于
      Currently, a FOO_lookup is an array of strings terminated by a NULL
      sentinel.
      
      A future patch will generate enums with "holes".  NULL-termination
      will cease to work then.
      
      To prepare for that, store the length in the FOO_lookup by wrapping it
      in a struct and adding a member for the length.
      
      The sentinel will be dropped next.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20170822132255.23945-13-marcandre.lureau@redhat.com>
      [Basically redone]
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1503564371-26090-16-git-send-email-armbru@redhat.com>
      [Rebased]
      f7abe0ec
    • M
      qapi: Drop superfluous qapi_enum_parse() parameter max · 06c60b6c
      Markus Armbruster 提交于
      The lookup tables have a sentinel, no need to make callers pass their
      size.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1503564371-26090-3-git-send-email-armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Rebased, commit message corrected]
      06c60b6c
    • M
      tests/qmp-test: Add generic, basic test of query commands · e4a426e7
      Markus Armbruster 提交于
      A command is a query if it has no side effect and yields a result.
      Such commands are typically named query-FOO, but there are exceptions.
      
      The basic idea is to find candidates with query-qmp-schema, filter out
      the ones that aren't queries with an explicit blacklist, and test the
      remaining ones against a QEMU with no special arguments.
      
      The current blacklist is just add-fd.
      
      The test can't do queries with arguments, because it knows nothing
      about the arguments.  No coverage for query-cpu-model-baseline,
      query-cpu-model-comparison, query-cpu-model-expansion, query-rocker,
      query-rocker-ports, query-rocker-of-dpa-flows, and
      query-rocker-of-dpa-groups.
      
      Most tested commands are expected to succeed.  The test does not check
      the return value then.
      
      query-balloon and query-vm-generation-id are expected to fail because
      they need a virtio-balloon / vmgenid device to succeed, and this test
      is too dumb to set one up.  Could be addressed later.
      
      query-acpi-ospm-status and query-hotpluggable-cpus are expected to
      fail because they require features provided only by special machine
      types, and this test is too dumb to set that up.  Could also be
      addressed later.
      
      Several commands may either be functional or stubs that always fail,
      depending on build configuration.  Ideally, the stubs shouldn't be in
      query-qmp-schema, but that requires QAPI schema compile-time
      configuration, which we don't have, yet.  Until we do, we need to
      figure out whether a command is a stub.  When we have a suitable
      CONFIG_FOO preprocessor symbol is available, use that.  Else,
      simply blacklist the command for now.
      
      We get basic test coverage for the following commands, except as
      noted:
      
          qom-list-types
          query-acpi-ospm-status      (expected to fail)
          query-balloon               (expected to fail)
          query-block
          query-block-jobs
          query-blockstats
          query-chardev
          query-chardev-backends
          query-command-line-options
          query-commands
          query-cpu-definitions       (blacklisted for now)
          query-cpus
          query-dump
          query-dump-guest-memory-capability
          query-events
          query-fdsets
          query-gic-capabilities      (blacklisted for now)
          query-hotpluggable-cpus     (expected to fail)
          query-iothreads
          query-kvm
          query-machines
          query-memdev
          query-memory-devices
          query-mice
          query-migrate
          query-migrate-cache-size
          query-migrate-capabilities
          query-migrate-parameters
          query-name
          query-named-block-nodes
          query-pci                   (blacklisted for now)
          query-qmp-schema
          query-rx-filter
          query-spice
          query-status
          query-target
          query-tpm
          query-tpm-models
          query-tpm-types
          query-uuid
          query-version
          query-vm-generation-id      (expected to fail)
          query-vnc
          query-vnc-servers
          query-xen-replication-status
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1502461148-10154-1-git-send-email-armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      [Typos in code under #ifndef and in the commit message fixed]
      e4a426e7
  15. 05 3月, 2017 2 次提交