1. 26 6月, 2015 18 次提交
  2. 25 6月, 2015 22 次提交
    • P
      test: Refactor testNodeGetCPUMap · 774fd399
      Peter Krempa 提交于
      Drop locking of the driver since it is not accessed and simplify the
      code flow.
      774fd399
    • P
      test: Refactor vcpu pinning and vcpu info retrieval · 3dd859c0
      Peter Krempa 提交于
      Drop internal data structures and use the proper fields in virDomainDef.
      
      This allows to greatly simplify the code and allows to remove the
      private data structure that was holding just redundant data.
      
      This patch also fixes the bogous output where we'd report that a fresh
      VM without vCPU pinning would not run on all vcpus.
      3dd859c0
    • P
      test: Refactor testDomainSetVcpusFlags · b69ffc57
      Peter Krempa 提交于
      Remove the bogus flag check and refactor the code by using
      virDomainObjGetDefs instead of virDomainObjGetPersistentDef.
      b69ffc57
    • P
      test: Refactor test driver domain object retrieval · d7356130
      Peter Krempa 提交于
      Reuse testDomObjFromDomain to retrieve domain objects in the rest of
      the test driver instead of open-coding it in every API.
      d7356130
    • P
      test: Drop locked access to testDriver->domains · 21be8e8e
      Peter Krempa 提交于
      Only self-locking APIs are used and the pointer is immutable so there's
      no need to lock the driver to access the domain list.
      
      This patch removes locking partially for everything that will not be
      converted to testDomObjFromDomain in the next patch.
      21be8e8e
    • P
      test: Finalize removal of locking from driver->eventState · caf5aef4
      Peter Krempa 提交于
      Don't lock the driver when registering event callbacks.
      caf5aef4
    • P
      test: Refactor test driver event sending · 678059c0
      Peter Krempa 提交于
      Make testObjectEventQueue tolerant to NULL @event and move it so that it
      does not require a prototype. Additionally we are now able to remove
      locking when accessing driver->eventState, since it's using self-locking
      APIs and the pointer is immutable.
      678059c0
    • P
      c1a34c87
    • P
      test: Annotate few fields of testDriver structure · beba6a0e
      Peter Krempa 提交于
      Some of the fields are either immutable or self locking, so make a note
      of that for future reference.
      beba6a0e
    • P
      test: Drop unused attribute @path from testDriver struct · 64eaac81
      Peter Krempa 提交于
      It's filled and then freed, but not used anywhere else.
      64eaac81
    • P
      81be2261
    • P
      test: Extract code to free testDriver into testDriverFree · 8b43335a
      Peter Krempa 提交于
      Avoid reimplementing it 3 times.
      8b43335a
    • P
      test: turn 'defaultConn' into a pointer · c54cfc45
      Peter Krempa 提交于
      c54cfc45
    • P
      test: Drop useless forward declaration · 2d0d07fe
      Peter Krempa 提交于
      2d0d07fe
    • P
      test: Rename testConn to testDriver · d0782da9
      Peter Krempa 提交于
      d0782da9
    • L
      qemu: Avoid removing persistent config if migration fails · 09444724
      Luyao Huang 提交于
      When migration fails in qemuMigrationPrepareAny, we unconditionally call
      qemuDomainRemoveInactive, which should only be called for transient
      domains. The check for !vm->persistent was accidentally removed by
      commit 540c339a.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      09444724
    • M
      vz: Adapt to driver rename · 84d0286e
      Michal Privoznik 提交于
      In the e6d180f0 commit the parallels driver was renamed to vz.
      However, there was a commit merged later, which was sent to the list
      before the rename. The other commit is 6de12b02. Fix all the
      missing renames.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      84d0286e
    • E
      json: enhance parser test · cb005533
      Eric Blake 提交于
      We already enable the parser option to detect invalid UTF-8, but
      didn't test it.  Also, JSON states that behavior of an object
      with a duplicated key is undefined; we chose to reject it, but
      were not testing it.
      
      With the enhanced tests in place, we can simplify yajl2
      initialization by relying on parser defaults being sane.
      
      * src/util/virjson.c (virJSONValueFromString): Simplify.
      * tests/jsontest.c (mymain): Test more bad usage.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cb005533
    • E
      json: even stricter trailing garbage detection · 7e191fd9
      Eric Blake 提交于
      Since older yajl ignores trailing garbage, a client can cause
      problems by intentionally ending the wrapper array early. Since
      we already track nesting, it's not too much harder to reject
      invalid nesting pops.
      
      * src/util/virjson. (_virJSONParser): Add field.
      (virJSONValueFromString): Set witness.
      (virJSONParserHandleEndArray): Use it to catch abuse.
      * tests/jsontest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7e191fd9
    • E
      json: reject trailing garbage · 7cd991b7
      Eric Blake 提交于
      Yajl 2 has a nice feature that it can be configured whether to
      allow multiple JSON objects parsed from a single stream, defaulting
      to off.  And yajl 1.0.12 at least provided a way to tell if all
      input bytes were parsed, or if trailing bytes remained after a
      valid JSON object was parsed.  But we target RHEL 6 yajl 1.0.7,
      which has neither of these.  So fake it by always parsing '[...]'
      instead, so that trailing garbage either trips up the array parse,
      or is easily detected when unwrapping the result.
      
      * src/util/virjson.c (virJSONValueFromString): With older json,
      wrap text to avoid trailing garbage.
      * tests/jsontest.c (mymain): Add tests for this.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7cd991b7
    • E
      json: reject javascript comments · 54dbba5b
      Eric Blake 提交于
      We have been allowing javascript style comments in JSON ever
      since commit 9428f2ce (v0.7.5), but qemu doesn't send them, and
      they are not strict JSON.  Reject them for now; if we can later
      prove that it is worthwhile, we can reinstate it at that point
      (or even make it conditional, by adding a bool parameter to
      the libvirt entry point).
      
      * src/util/virjson.c (virJSONValueFromString): Don't enable
      comment parsing.
      * tests/jsontest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      54dbba5b
    • E
      json: cope with older yajl semantics · f2acaebd
      Eric Blake 提交于
      Commit ceb496e5 fails on RHEL 6, with yajl 1.0.7, because that
      version of yajl returns yajl_status_insufficient_data when the
      parser is waiting for the rest of a token (this enum value was
      dropped in yajl 2, so we have to wrap it).  It also exposes a
      problem where older yajl silently ignores trailing garbage after
      a successful parse, so this patch works around that by changing
      the testsuite.  Another more invasive patch can add tighter
      semantics to json parsing, but this is sufficient for a minimal
      clean backport.
      
      While touching this, fix up our error message cleanup. Yajl
      documents that error messages produced by yajl_get_error()
      MUST be cleaned with yajl_free_error(); this is certainly
      true if we were to pass non-NULL allocator callbacks during
      yajl_alloc(), but probably harmless in our usage of passing
      NULL.  But better safe than sorry.
      
      * src/util/virjson.c (virJSONValueFromString): Allow different
      error code.  Use canonical cleanup of error message.
      (VIR_YAJL_STATUS_OK): New helper macro.
      * tests/jsontest.c (mymain): Wrap text to avoid difference in
      trailing garbage handling
      Signed-off-by: NEric Blake <eblake@redhat.com>
      f2acaebd