1. 17 7月, 2014 1 次提交
  2. 04 7月, 2014 2 次提交
    • P
      qemu: monitor: Add argument for specifying backing name for block commit · c29b6529
      Peter Krempa 提交于
      To allow changing the name that is recorded in the overlay of the TOP
      image used in a block commit operation, we need to specify the backing
      name to qemu. This is done via the "backing-file" attribute to the
      block-commit command.
      c29b6529
    • E
      blockjob: allow omitted arguments to QMP block-commit · 47549d5a
      Eric Blake 提交于
      We are about to turn on support for active block commit.  Although
      qemu 2.0 was the first version to mostly support it, that version
      mis-handles 0-length files, and doesn't have anything available for
      easy probing.  But qemu 2.1 fixed bugs, and made life simpler by
      letting the 'top' argument be optional.  Unless someone begs for
      active commit with qemu 2.0, for now we are just going to enable
      it only by probing for qemu 2.1 behavior (anyone backporting active
      commit can also backport the optional argument behavior).  This
      requires qemu.git commit 7676e2c597000eff3a7233b40cca768b358f9bc9.
      
      Although all our actual uses of block-commit supply arguments for
      both base and top, we can omit both arguments and use a bogus
      device string to trigger an interesting behavior in qemu.  All QMP
      commands first do argument validation, failing with GenericError
      if a mandatory argument is missing.  Once that passes, the code
      in the specific command gets to do further checking, and the qemu
      developers made sure that if device is the only supplied argument,
      then the block-commit code will look up the device first, with a
      failure of DeviceNotFound, before attempting any further argument
      validation (most other validations fail with GenericError).  Thus,
      the category of error class can reliably be used to decipher
      whether the top argument was optional, which in turn implies a
      working active commit.  Since we expect our bogus device string to
      trigger an error either way, the code is written to return a
      distinct return value without spamming the logs.
      
      * src/qemu/qemu_monitor.h (qemuMonitorSupportsActiveCommit): New
      prototype.
      * src/qemu/qemu_monitor.c (qemuMonitorSupportsActiveCommit):
      Implement it.
      * src/qemu/qemu_monitor_json.h (qemuMonitorJSONBlockCommit):
      Allow NULL for top and base, for probing purposes.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONBlockCommit):
      Likewise, implementing the probe.
      * tests/qemumonitorjsontest.c (mymain): Enable...
      (testQemuMonitorJSONqemuMonitorSupportsActiveCommit): ...a new test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      47549d5a
  3. 03 6月, 2014 1 次提交
    • P
      qemu: monitor: Fix type of holdtime argument in qemuMonitorJSONSendKey · ce2107a9
      Peter Krempa 提交于
      qemuMonitorJSONSendKey declares the "holdtime" argument as unsigned int
      while the command was constructed in qemuMonitorJSONMakeCommand using
      the "P" modifier which took a unsigned long from the variable
      arguments which then made it possible to access uninitialized memory.
      
      This broke the qemumonitorjsontest on 32bit fedora 20:
      64) qemuMonitorJSONSendKey
      ... libvirt: QEMU Driver error : internal error: unsupported data type 'W' for arg 'WVSƒì ‹D$0è‘wÿÿÃAå' FAILED
      
      Uncovered by upstream commit f744b831.
      
      Additionally add test for the hold-time option.
      ce2107a9
  4. 07 4月, 2014 1 次提交
    • E
      hash: add common utility functions · 09567144
      Eric Blake 提交于
      I almost wrote a hash value free function that just called
      VIR_FREE, then realized I couldn't be the first person to
      do that.  Sure enough, it was worth factoring into a common
      helper routine.
      
      * src/util/virhash.h (virHashValueFree): New function.
      * src/util/virhash.c (virHashValueFree): Implement it.
      * src/util/virobject.h (virObjectFreeHashData): New function.
      * src/libvirt_private.syms (virhash.h, virobject.h): Export them.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit): Use
      common function.
      * src/qemu/qemu_capabilities.c (virQEMUCapsCacheNew): Likewise.
      * src/qemu/qemu_command.c (qemuDomainCCWAddressSetCreate):
      Likewise.
      * src/qemu/qemu_monitor.c (qemuMonitorGetBlockInfo): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      * src/util/virclosecallbacks.c (virCloseCallbacksNew): Likewise.
      * src/util/virkeyfile.c (virKeyFileParseGroup): Likewise.
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBlockInfo): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      09567144
  5. 25 3月, 2014 3 次提交
  6. 20 1月, 2014 1 次提交
  7. 19 11月, 2013 1 次提交
  8. 13 11月, 2013 2 次提交
  9. 08 11月, 2013 1 次提交
  10. 15 10月, 2013 1 次提交
    • E
      maint: avoid 'const fooPtr' in tests · b8984770
      Eric Blake 提交于
      'const fooPtr' is the same as 'foo * const' (the pointer won't
      change, but it's contents can).  But in general, if an interface
      is trying to be const-correct, it should be using 'const foo *'
      (the pointer is to data that can't be changed).
      
      Fix up offenders in the testsuite.
      
      * tests/cputest.c (cpuTestCompareXML): Use intended type.
      * tests/qemucapabilitiestest.c (testQemuCaps): Likewise.
      * tests/qemumonitorjsontest.c: Drop const.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      b8984770
  11. 11 10月, 2013 4 次提交
  12. 08 10月, 2013 1 次提交
  13. 05 10月, 2013 1 次提交
    • E
      build: fix build on 32-bit platforms · 815e3098
      Eric Blake 提交于
      qemumonitorjsontest.c: In function 'testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo':
      qemumonitorjsontest.c:1134: warning: integer constant is too large for 'long' type
      
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo)
      (testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo): Use correct
      type.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      815e3098
  14. 03 10月, 2013 11 次提交
  15. 20 9月, 2013 1 次提交
  16. 19 9月, 2013 2 次提交
  17. 26 8月, 2013 1 次提交
  18. 22 7月, 2013 1 次提交
  19. 20 7月, 2013 1 次提交
  20. 16 7月, 2013 3 次提交
    • J
      Add qemuMonitorJSONSetObjectProperty() method for QMP qom-set command · 50336d87
      John Ferlan 提交于
      Add a new qemuMonitorJSONSetObjectProperty() method to support invocation
      of the 'qom-set' JSON monitor command with a provided path, property, and
      expected data type to set.
      
      NOTE: The set API was added only for the purpose of the qemumonitorjsontest
      
      The test code uses the same "/machine/i440fx" property as the get test and
      attempts to set the "realized" property to "true" (which it should be set
      at anyway).
      50336d87
    • J
      Add qemuMonitorJSONGetObjectProperty() method for QMP qom-get command · bdce2789
      John Ferlan 提交于
      Add a new qemuMonitorJSONGetObjectProperty() method to support invocation
      of the 'qom-get' JSON monitor command with a provided path, property, and
      expected data type return. The qemuMonitorJSONObjectProperty is similar to
      virTypedParameter; however, a future patch will extend it a bit to include
      a void pointer to balloon driver statistic data.
      
      NOTE: The ObjectProperty structures and API are added only for the
            purpose of the qemumonitorjsontest
      
      The provided test will execute a qom-get on "/machine/i440fx" which will
      return a property "realized".
      bdce2789
    • J
      Add qemuMonitorJSONGetObjectListPaths() method for QMP qom-list command · d76a8978
      John Ferlan 提交于
      Add a new qemuMonitorJSONGetObjectListPaths() method to support invocation
      of the 'qom-list' JSON monitor command with a provided path.
      
      NOTE: The ListPath structures and API's are added only for the
            purpose of the qemumonitorjsontest
      
      The returned list of paired data fields of "name" and "type" that can
      be used to peruse QOM configuration data and eventually utilize for the
      balloon statistics.
      
      The test does a "{"execute":"qom-list", "arguments": { "path": "/"}}" which
      returns "{"return": [{"name": "machine", "type": "child<container>"},
      {"name": "type", "type": "string"}]}" resulting in a return of an array
      of 2 elements with [0].name="machine", [0].type="child<container>".  The [1]
      entry appears to be a header that could be used some day via a command such
      as "virsh qemuobject --list" to format output.
      d76a8978