1. 28 5月, 2014 1 次提交
  2. 25 5月, 2014 2 次提交
  3. 19 5月, 2014 10 次提交
  4. 16 5月, 2014 3 次提交
    • B
      qapi: skip redundant includes · 24fd8489
      Benoît Canet 提交于
      The purpose of this change is to help create a json file containing
      common definitions; each bit of generated C code must be emitted
      only one time.
      
      A second history global to all QAPISchema instances has been added
      to detect when a file is included more than one time and skip these
      includes.
      It does not act as a stack and the changes made to it by the
      __init__ function are propagated back to the caller so it's really
      a global state.
      Signed-off-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      24fd8489
    • M
      qapi: Replace uncommon use of the error API by the common one · 297a3646
      Markus Armbruster 提交于
      We commonly use the error API like this:
      
          err = NULL;
          foo(..., &err);
          if (err) {
              goto out;
          }
          bar(..., &err);
      
      Every error source is checked separately.  The second function is only
      called when the first one succeeds.  Both functions are free to pass
      their argument to error_set().  Because error_set() asserts no error
      has been set, this effectively means they must not be called with an
      error set.
      
      The qapi-generated code uses the error API differently:
      
          // *errp was initialized to NULL somewhere up the call chain
          frob(..., errp);
          gnat(..., errp);
      
      Errors accumulate in *errp: first error wins, subsequent errors get
      dropped.  To make this work, the second function does nothing when
      called with an error set.  Requires non-null errp, or else the second
      function can't see the first one fail.
      
      This usage has also bled into visitor tests, and two device model
      object property getters rtc_get_date() and balloon_stats_get_all().
      
      With the "accumulate" technique, you need fewer error checks in
      callers, and buy that with an error check in every callee.  Can be
      nice.
      
      However, mixing the two techniques is confusing.  You can't use the
      "accumulate" technique with functions designed for the "check
      separately" technique.  You can use the "check separately" technique
      with functions designed for the "accumulate" technique, but then
      error_set() can't catch you setting an error more than once.
      
      Standardize on the "check separately" technique for now, because it's
      overwhelmingly prevalent.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      297a3646
    • M
      tests: Don't call visit_end_struct() after visit_start_struct() fails · cdaec380
      Markus Armbruster 提交于
      When visit_start_struct() fails, visit_end_struct() must not be
      called.  Three out of four visit_type_TestStruct() call it anyway.  As
      far as I can tell, visit_start_struct() doesn't actually fail there.
      Fix them anyway.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
      cdaec380
  5. 15 5月, 2014 1 次提交
  6. 14 5月, 2014 1 次提交
  7. 10 5月, 2014 4 次提交
    • J
      block: qemu-iotests - test for live migration · fd040174
      Jeff Cody 提交于
      This is an initial, simple live migration test from one
      running VM to another, using monitor commands.
      
      This is also an example of using the new common.qemu functions
      for controlling multiple running qemu instances, for tests that
      need a live qemu vm.
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      fd040174
    • J
      block: qemu-iotests - update 085 to use common.qemu · e86e8697
      Jeff Cody 提交于
      The new functionality of common.qemu implements the QEMU control
      and communication functionality that was originally in test 085.
      
      This removes that now-duplicate functionality, and uses the
      common.qemu functions.
      
      The QEMU commandline changes slightly due to this; in addition to
      monitor and qmp i/o options, the new QEMU commandline from inside
      common.qemu now introduces -machine accel=qtest.
      Reviewed-by: NBenoit Canet <benoit@irqsave.net>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e86e8697
    • J
      block: qemu-iotests - add common.qemu, for bash-controlled qemu tests · e940bc13
      Jeff Cody 提交于
      This creates some common functions for bash language qemu-iotests
      to control, and communicate with, a running QEMU process.
      
      4 functions are introduced:
      
          1. _launch_qemu()
              This launches the QEMU process(es), and sets up the file
              descriptors and fifos for communication.  You can choose to
              launch each QEMU process listening for either QMP or HMP
              monitor.  You can call this function multiple times, and
              save the handle returned from each.  The returned handle is
              in $QEMU_HANDLE.  You must copy this value.
      
      Commands 2 and 3 use the handle received from _launch_qemu(), to talk
      to the appropriate process.
      
          2. _send_qemu_cmd()
              Sends a command string, specified by $2, to QEMU.  If $3 is
              non-NULL, _send_qemu_cmd() will wait to receive $3 as a
              required result string from QEMU.  Failure to receive $3 will
              cause the test to fail.  The command can optionally be retried
              $qemu_cmd_repeat number of times.  Set $qemu_error_no_exit
              to not force the test the fail on exit; in this case,
              $QEMU_STATUS[$1] will be set to -1 on failure.
      
          3. _timed_wait_for()
              Waits for a response, for up to a default of 10 seconds.  If
              $2 is not seen in that time (anywhere in the response), then
              the test fails.  Primarily used by _send_qemu_cmd, but could
              be useful standalone, as well.  To prevent automatic exit
              (and therefore test failure), set $qemu_error_no_exit to a
              non-NULL value.  If $silent is a non-NULL value, then output
              to stdout will be suppressed.
      
          4. _cleanup_qemu()
              Kills the running QEMU processes, and removes the fifos.
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e940bc13
    • K
      block: Fix open flags with BDRV_O_SNAPSHOT · b1e6fc08
      Kevin Wolf 提交于
      The immediately visible effect of this patch is that it fixes committing
      a temporary snapshot to its backing file. Previously, it would fail with
      a "permission denied" error because bdrv_inherited_flags() forced the
      backing file to be read-only, ignoring the r/w reopen of bdrv_commit().
      
      The bigger problem this revealed is that the original open flags must
      actually only be applied to the temporary snapshot, and the original
      image file must be treated as a backing file of the temporary snapshot
      and get the right flags for that.
      Reported-by: NJan Kiszka <jan.kiszka@web.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      b1e6fc08
  8. 09 5月, 2014 9 次提交
  9. 08 5月, 2014 1 次提交
    • P
      tests/tcg: Fix compilation of test_path · ad0a118f
      Peter Maydell 提交于
      The test_path binary is (unlike the other test binaries in tests/tcg)
      actually intended to be compiled with the same compiler used to build
      the main QEMU executables. It actually #includes a number of the
      QEMU source files in an attempt to unit-test the util/path.c functions,
      and so if it is not compiled with the same compiler used by configure
      to set CONFIG_ settings then it is liable to fail to build.
      Fix the makefile to build it with the default C compiler rules, not
      CC_I386, and fix the test itself not to include a lot of unnecessary
      trace related source files which cause the build to fail if the trace
      backend is anything other than 'simple'.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      ad0a118f
  10. 06 5月, 2014 8 次提交