1. 19 5月, 2016 2 次提交
  2. 12 5月, 2016 7 次提交
    • S
      qemu-iotests: iotests: fail hard if not run via "check" · 5a8fabf3
      Sascha Silbe 提交于
      Running an iotests-based Python test directly might appear to work,
      but may fail in subtle ways and is insecure:
      
      - It creates files with predictable file names in a world-writable
        location (/var/tmp).
      
      - Tests expect the environment to be set up by check. E.g. 041 and 055
        may take the wrong code paths if QEMU_DEFAULT_MACHINE is not
        set. This can lead to false negatives.
      
      Instead fail hard and tell the user we want to be run via "check".
      
      The actual environment expected by the tests is currently only defined
      by the implementation of "check". We use two of the environment
      variables set by "check" as indication of whether we're being run via
      "check". Anyone writing their own test runner (replacing "check") will
      need to replicate the full environment (in a broader sense, not just
      environment variables) provided by "check" anyway, including setting
      the two environment variables we check. Whereas a regular developer
      just trying to invoke the tests usually won't have both of these
      defined in their environment so we can catch their mistake and give
      out useful advice.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1461094442-16014-1-git-send-email-silbe@linux.vnet.ibm.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      5a8fabf3
    • D
      block: enable testing of LUKS driver with block I/O tests · 4e9b25fb
      Daniel P. Berrange 提交于
      This adds support for testing the LUKS driver with the block
      I/O test framework.
      
         cd tests/qemu-io-tests
         ./check -luks
      
      A handful of test cases are modified to work with luks
      
       - 004 - whitelist luks format
       - 012 - use TEST_IMG_FILE instead of TEST_IMG for file ops
       - 048 - use TEST_IMG_FILE instead of TEST_IMG for file ops.
               don't assume extended image contents is all zeros,
               explicitly initialize with zeros
               Make file size smaller to avoid having to decrypt
               1 GB of data.
       - 052 - don't assume initial image contents is all zeros,
               explicitly initialize with zeros
       - 100 - don't assume initial image contents is all zeros,
               explicitly initialize with zeros
      
      With this patch applied, the results are as follows:
      
        Passed: 001 002 003 004 005 008 009 010 011 012 021 032 043
                047 048 049 052 087 100 134 143
        Failed: 033 120 140 145
       Skipped: 007 013 014 015 017 018 019 020 022 023 024 025 026
                027 028 029 030 031 034 035 036 037 038 039 040 041
                042 043 044 045 046 047 049 050 051 053 054 055 056
                057 058 059 060 061 062 063 064 065 066 067 068 069
                070 071 072 073 074 075 076 077 078 079 080 081 082
                083 084 085 086 087 088 089 090 091 092 093 094 095
                096 097 098 099 101 102 103 104 105 107 108 109 110
                111 112 113 114 115 116 117 118 119 121 122 123 124
                128 129 130 131 132 133 134 135 136 137 138 139 141
                142 144 146 148 150 152
      
      The reasons for the failed tests are:
      
       - 033 - needs adapting to use image opts syntax with blkdebug
               and test image in order to correctly set align property
       - 120 - needs adapting to use correct -drive syntax for luks
       - 140 - needs adapting to use correct -drive syntax for luks
       - 145 - needs adapting to use correct -drive syntax for luks
      
      The vast majority of skipped tests are exercising code that is
      qcow2 specific, though a couple could probably be usefully
      enabled for luks too.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1462896689-18450-4-git-send-email-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      4e9b25fb
    • D
      block: add support for encryption secrets in block I/O tests · b7e875b2
      Daniel P. Berrange 提交于
      The LUKS block driver tests will require the ability to specify
      encryption secrets with block devices. This requires using the
      --object argument to qemu-img/qemu-io to create a 'secret'
      object.
      
      When the IMGKEYSECRET env variable is set, it provides the
      password to be associated with a secret called 'keysec0'
      
      The _qemu_img_wrapper function isn't modified as that needs
      to cope with differing syntax for subcommands, so can't be
      made to use the image opts syntax unconditionally.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1462896689-18450-3-git-send-email-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      b7e875b2
    • D
      block: add support for --image-opts in block I/O tests · 076003f5
      Daniel P. Berrange 提交于
      Currently all block tests use the traditional syntax for images
      just specifying a filename. To support the LUKS driver without
      resorting to JSON, the tests need to be able to use the new
      --image-opts argument to qemu-img and qemu-io.
      
      This introduces a new env variable IMGOPTSSYNTAX. If this is
      set to 'true', then qemu-img/qemu-io should use --image-opts.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-id: 1462896689-18450-2-git-send-email-berrange@redhat.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      076003f5
    • E
      qemu-io: Allow unaligned access by default · 093ea232
      Eric Blake 提交于
      There's no reason to require the user to specify a flag just so
      they can pass in unaligned numbers.  Keep 'read -p' and 'write -p'
      as no-ops so that I don't have to hunt down and update all users
      of qemu-io, but otherwise make their behavior default as 'read' and
      'write'.  Also fix 'write -z', 'readv', 'writev', 'writev',
      'aio_read', 'aio_write', and 'aio_write -z'.  For now, 'read -b',
      'write -b', and 'write -c' still require alignment (and 'multiwrite',
      but that's slated to die soon).
      
      qemu-iotest 23 is updated to match, as the only test that was
      previously explicitly expecting an error on an unaligned request.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-id: 1462677405-4752-5-git-send-email-eblake@redhat.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      093ea232
    • W
      iotests: fix the redirection order in 083 · 9036e87c
      Wei Jiangang 提交于
      It should redirect stdout to /dev/null first,
      then redirect stderr to whatever stdout currently points at.
      Signed-off-by: NWei Jiangang <weijg.fnst@cn.fujitsu.com>
      Message-id: 1461665601-14908-1-git-send-email-weijg.fnst@cn.fujitsu.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      9036e87c
    • J
      Allow users to specify the vmdk virtual hardware version. · f249924e
      Janne Karhunen 提交于
      Vmdk images have metadata to indicate the vmware virtual
      hardware version image was created/tested to run with.
      Allow users to specify that version via new 'hwversion'
      option.
      
      [ kwolf: Adjust qemu-iotests common.filter ]
      Signed-off-by: NJanne Karhunen <Janne.Karhunen@gmail.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f249924e
  3. 20 4月, 2016 3 次提交
  4. 15 4月, 2016 6 次提交
  5. 13 4月, 2016 8 次提交
    • S
      qemu-iotests: iotests.py: get rid of __all__ · 3ef3dcef
      Sascha Silbe 提交于
      The __all__ list contained a typo for as long as the iotests module
      existed. That typo prevented "from iotests import *" (which is the
      only case where iotests.__all__ is used at all) from ever working.
      
      The names used by iotests are highly prone to name collisions, so
      importing them all unconditionally is a bad idea anyway. Since __all__
      is not adding any value, let's just get rid of it.
      
      Fixes: f345cfd0 ("qemu-iotests: add iotests Python module")
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-8-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      3ef3dcef
    • S
      qemu-iotests: 068: don't require KVM · 9bf8027d
      Sascha Silbe 提交于
      None of the other test cases explicitly enable KVM and there's no
      obvious reason for 068 to require it. Drop this so all test cases can be
      executed in environments where KVM is not available (e.g. because the
      user doesn't have sufficient permissions to access /dev/kvm).
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-6-git-send-email-silbe@linux.vnet.ibm.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      9bf8027d
    • S
      qemu-iotests: 148: properly skip test if quorum support is missing · 3f647b51
      Sascha Silbe 提交于
      qemu-iotests test case 148 already had some code for skipping the test
      if quorum support is missing, but it didn't work in all
      cases. TestQuorumEvents.setUp() gets run before the actual test class
      (which contains the skipping code) and tries to start qemu with a drive
      using the quorum driver. For some reason this works fine when using
      qcow2, but fails for raw.
      
      As the entire test case requires quorum, just check for availability
      before even starting the test suite. Introduce a verify_quorum()
      function in iotests.py for this purpose so future test cases can make
      use of it.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-5-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      3f647b51
    • S
      qemu-iotests: iotests.VM: remove qtest socket on error · c1c71e49
      Sascha Silbe 提交于
      On error, VM.launch() cleaned up the monitor unix socket, but left the
      qtest unix socket behind. This caused the remaining sub-tests to fail
      with EADDRINUSE:
      
      +======================================================================
      +ERROR: testQuorum (__main__.TestFifoQuorumEvents)
      +----------------------------------------------------------------------
      +Traceback (most recent call last):
      +  File "148", line 63, in setUp
      +    self.vm.launch()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/iotests.py", line 247, in launch
      +    self._qmp.accept()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 141, in accept
      +    return self.__negotiate_capabilities()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/../../scripts/qmp/qmp.py", line 57, in __negotiate_capabilities
      +    raise QMPConnectError
      +QMPConnectError
      +
      +======================================================================
      +ERROR: testQuorum (__main__.TestQuorumEvents)
      +----------------------------------------------------------------------
      +Traceback (most recent call last):
      +  File "148", line 63, in setUp
      +    self.vm.launch()
      +  File "/home6/silbe/qemu/tests/qemu-iotests/iotests.py", line 244, in launch
      +    self._qtest = qtest.QEMUQtestProtocol(self._qtest_path, server=True)
      +  File "/home6/silbe/qemu/tests/qemu-iotests/../../scripts/qtest.py", line 33, in __init__
      +    self._sock.bind(self._address)
      +  File "/usr/lib64/python2.7/socket.py", line 224, in meth
      +    return getattr(self._sock,name)(*args)
      +error: [Errno 98] Address already in use
      
      Fix this by cleaning up both the monitor socket and the qtest socket iff
      they exist.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-4-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      c1c71e49
    • S
      qemu-iotests: fix 051 on non-PC architectures · 1759386b
      Sascha Silbe 提交于
      Commit 61de4c68 [block: Remove BDRV_O_CACHE_WB] updated the reference
      output for PCs, but neglected to do the same for the generic reference
      output file. Fix 051 on all non-PC architectures by applying the same
      change to the generic output file.
      
      Fixes: 61de4c68 ("block: Remove BDRV_O_CACHE_WB")
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-3-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      1759386b
    • S
      qemu-iotests: check: don't place files with predictable names in /tmp · 0145b4e1
      Sascha Silbe 提交于
      Placing files with predictable or even hard-coded names in /tmp is a
      security risk and can prevent or disturb operation on a multi-user
      machine. Place them inside the "scratch" directory instead, as we
      already do for most other test-related files.
      Signed-off-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
      Reviewed-by: NBo Tu <tubo@linux.vnet.ibm.com>
      Message-id: 1459848109-29756-2-git-send-email-silbe@linux.vnet.ibm.com
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      0145b4e1
    • M
      iotests: Make 150 use qemu-img map instead of du · 1fd06db0
      Max Reitz 提交于
      The actual on-disk size of a file does not only depend on factors qemu
      can control. Thus, we should not depend on this to determine whether a
      file has indeed been fully allocated. Instead, use qemu-img map and hope
      that if an area is referenced, it is indeed allocated, too.
      
      Also, limit the supported image formats to raw and qcow2 because the
      actual qemu-img map output may depend on the image format.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Tested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1fd06db0
    • P
      iotests: fix the broken 026.nocache output · af74e865
      Pavel Butsykin 提交于
      This patch fixes longstanding issue with 026 iotest. Unfortunately,
      this test contains 2 versions of the correct output, one for cached
      writes and one for non-cached ones. People tends to fix only one
      version of output of the test and thus noncached version becomes
      broken. Unfortunately, it is default in tests/check-block.sh
      
      The following problematic commits were made:
          commit 3b5e14c7
          Author: Max Reitz <mreitz@redhat.com>
          Date:   Tue Dec 2 18:32:51 2014 +0100
          qcow2: Flushing the caches in qcow2_close may fail
      
          commit a069e2f1
          Author: John Snow <jsnow@redhat.com>
          Date:   Fri Feb 6 16:26:17 2015 -0500
          blkdebug: fix "once" rule
      
          commit b106ad91
          Author: Kevin Wolf <kwolf@redhat.com>
          Date:   Fri Mar 28 18:06:31 2014 +0100
          qcow2: Don't rely on free_cluster_index in alloc_refcount_block()
      Signed-off-by: NPavel Butsykin <pbutsykin@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Max Reitz <mreitz@redhat.com>
      CC: John Snow <jsnow@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      af74e865
  6. 05 4月, 2016 1 次提交
  7. 30 3月, 2016 13 次提交
    • M
      iotests: Test qemu-img convert -S 0 behavior · f4e732a0
      Max Reitz 提交于
      Passing -S 0 to qemu-img convert should result in all source data being
      copied to the output, even if that source data is known to be 0. The
      output image should therefore have exactly the same size on disk as an
      image which we explicitly filled with data.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f4e732a0
    • M
      qemu-img: Fix preallocation with -S 0 for convert · aad15de4
      Max Reitz 提交于
      When passing -S 0 to qemu-img convert, the target image is supposed to
      be fully allocated. Right now, this is not the case if the source image
      contains areas which bdrv_get_block_status() reports as being zero.
      
      This patch changes a zeroed area's status from BLK_ZERO to BLK_DATA
      before invoking convert_write() if -S 0 has been specified. In addition,
      the check whether convert_read() actually needs to do anything
      (basically only if the current area is a BLK_DATA area) is pulled out of
      that function to the caller.
      
      If -S 0 has been specified, zeroed areas need to be written as data to
      the output, thus they then have to be accounted when calculating the
      progress made.
      
      This patch changes the reference output for iotest 122; contrary to what
      it assumed, -S 0 really should allocate everything in the output, not
      just areas that are filled with zeros (as opposed to being zeroed).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      aad15de4
    • K
      block: Remove BDRV_O_CACHE_WB · 61de4c68
      Kevin Wolf 提交于
      The previous patches have successively made blk->enable_write_cache the
      true source for the information whether a writethrough mode must be
      implemented. The corresponding BDRV_O_CACHE_WB is only useless baggage
      we're carrying around, so now's the time to remove it.
      
      At the same time, we remove the 'cache.writeback' option parsing on the
      BDS level as the only effect was setting the BDRV_O_CACHE_WB flag.
      
      This change requires test cases that explicitly enabled the option to
      drop it. Other than that and the change of the error message when
      writethrough is enabled on the BDS level (from "Can't set writethrough
      mode" to "doesn't support the option"), there should be no change in
      behaviour.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      61de4c68
    • K
      qemu-io: Use bdrv_parse_cache_mode() in reopen_f() · 19dbecdc
      Kevin Wolf 提交于
      We must forbid changing the WCE flag in bdrv_reopen() in the same patch,
      as otherwise the behaviour would change so that the flag takes
      precedence over the explicitly specified option.
      
      The correct value of the WCE flag depends on the BlockBackend user (e.g.
      guest device) and isn't a decision that the QMP client makes, so this
      change is what we want.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      19dbecdc
    • K
      block/qapi: Use blk_enable_write_cache() · c83f9fba
      Kevin Wolf 提交于
      Now that WCE is handled on the BlockBackend level, the flag is
      meaningless for BDSes. As the schema requires us to fill the field,
      we return an enabled write cache for them.
      
      Note that this means that querying the BlockBackend name may return
      writethrough as the cache information, whereas querying the node-name of
      the root of that same BlockBackend will return writeback.
      
      This may appear odd at first, but it actually makes sense because it
      correctly repesents the layer that implements the WCE handling. This
      becomes more apparent when you consider nodes that are the root node of
      multiple BlockBackends, where each BB can have its own WCE setting.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      c83f9fba
    • K
      block: Move enable_write_cache to BB level · bfd18d1e
      Kevin Wolf 提交于
      Whether a write cache is used or not is a decision that concerns the
      user (e.g. the guest device) rather than the backend. It was already
      logically part of the BB level as bdrv_move_feature_fields() always kept
      it on top of the BDS tree; with this patch, the core of it (the actual
      flag and the additional flushes) is also implemented there.
      
      Direct callers of bdrv_open() must pass BDRV_O_CACHE_WB now if bs
      doesn't have a BlockBackend attached.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      bfd18d1e
    • D
      block: an interoperability test for luks vs dm-crypt/cryptsetup · 6278ae03
      Daniel P. Berrange 提交于
      It is important that the QEMU luks implementation retains 100%
      compatibility with the reference implementation provided by
      the combination of the linux kernel dm-crypt module and cryptsetup
      userspace tools.
      
      There is a matrix of tests to be performed with different sets
      of encryption settings. For each matrix entry, two tests will
      be performed. One will create a LUKS image with the cryptsetup
      tool and then do I/O with both cryptsetup & qemu-io. The other
      will create the image with qemu-img and then again do I/O with
      both cryptsetup and qemu-io.
      
      The new I/O test 149 performs interoperability testing between
      QEMU and the reference implementation. Such testing inherantly
      requires elevated privileges, so to this this the user must have
      configured passwordless sudo access. The test will automatically
      skip if sudo is not available.
      
      The test has to be run explicitly thus:
      
          cd tests/qemu-iotests
          ./check -luks 149
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6278ae03
    • D
      block: move encryption deprecation warning into qcow code · e6ff69bf
      Daniel P. Berrange 提交于
      For a couple of releases we have been warning
      
        Encrypted images are deprecated
        Support for them will be removed in a future release.
        You can use 'qemu-img convert' to convert your image to an unencrypted one.
      
      This warning was issued by system emulators, qemu-img, qemu-nbd
      and qemu-io. Such a broad warning was issued because the original
      intention was to rip out all the code for dealing with encryption
      inside the QEMU block layer APIs.
      
      The new block encryption framework used for the LUKS driver does
      not rely on the unloved block layer API for encryption keys,
      instead using the QOM 'secret' object type. It is thus no longer
      appropriate to warn about encryption unconditionally.
      
      When the qcow/qcow2 drivers are converted to use the new encryption
      framework too, it will be practical to keep AES-CBC support present
      for use in qemu-img, qemu-io & qemu-nbd to allow for interoperability
      with older QEMU versions and liberation of data from existing encrypted
      qcow2 files.
      
      This change moves the warning out of the generic block code and
      into the qcow/qcow2 drivers. Further, the warning is set to only
      appear when running the system emulators, since qemu-img, qemu-io,
      qemu-nbd are expected to support qcow2 encryption long term now that
      the maint burden has been eliminated.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e6ff69bf
    • D
      tests: add output filter to python I/O tests helper · a2d1c8fd
      Daniel P. Berrange 提交于
      Add a 'log' method to iotests.py which prints messages to
      stdout, with optional filtering of data. Port over some
      standard filters already present in the shell common.filter
      code to be usable in python too.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a2d1c8fd
    • D
      tests: refactor python I/O tests helper main method · c6a92369
      Daniel P. Berrange 提交于
      The iotests.py helper provides a main() method for running
      tests via the python unit test framework. Not all tests
      will want to use this, so refactor it to split the testing
      of compatible formats and platforms into separate helper
      methods
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c6a92369
    • D
      tests: redirect stderr to stdout for iotests · 491e5e85
      Daniel P. Berrange 提交于
      The python I/O tests helper for running qemu-img/qemu-io
      setup stdout to be captured to a pipe, but left stderr
      untouched. As a result, if something failed in qemu-img/
      qemu-io, data written to stderr would get output directly
      and not line up with data on the test stdout due to
      buffering.  If we explicitly redirect stderr to the same
      pipe as stdout, things are much clearer when they go
      wrong.
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      491e5e85
    • K
      block: Reject writethrough mode except at the root · 73ac451f
      Kevin Wolf 提交于
      Writethrough mode is going to become a BlockBackend feature rather than
      a BDS one, so forbid it in places where we won't be able to support it
      when the code finally matches the envisioned design.
      
      We only allowed setting the cache mode of non-root nodes after the 2.5
      release, so we're still free to make this change.
      
      The target of block jobs is now always opened in a writeback mode
      because it doesn't have a BlockBackend attached. This makes more sense
      anyway because block jobs know when to flush. If the graph is modified
      on job completion, the original cache mode moves to the new root, so
      for the guest device writethough always stays enabled if it was
      configured this way.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      73ac451f
    • K
      block: Make backing files always writeback · b8816a43
      Kevin Wolf 提交于
      First of all, we're generally not writing to backing files, but when we
      do, it's in the context of block jobs which know very well when to flush
      the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      b8816a43