1. 15 3月, 2016 3 次提交
  2. 14 3月, 2016 1 次提交
    • K
      block: Fix snapshot=on cache modes · 73176bee
      Kevin Wolf 提交于
      Since commit 91a097e7, we end up with a somewhat weird cache mode
      configuration with snapshot=on: The commit broke the cache mode
      inheritance for the snapshot overlay so that it is opened as
      writethrough instead of unsafe now. The following bdrv_append() call to
      put it on top of the tree swaps the WCE flag with the snapshot's backing
      file (i.e. the originally given file), so what we eventually get is
      cache=writeback on the temporary overlay and
      cache=writethrough,cache.no-flush=on on the real image file.
      
      This patch changes things so that the temporary overlay gets
      cache=unsafe again like it used to, and the real images get whatever the
      user specified. This means that cache.direct is now respected even with
      snapshot=on, and in the case of committing changes, the final flush is
      no longer ignored except explicitly requested by the user.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      73176bee
  3. 03 2月, 2016 4 次提交
  4. 20 1月, 2016 2 次提交
    • K
      block: Inactivate BDS when migration completes · 76b1c7fe
      Kevin Wolf 提交于
      So far, live migration with shared storage meant that the image is in a
      not-really-ready don't-touch-me state on the destination while the
      source is still actively using it, but after completing the migration,
      the image was fully opened on both sides. This is bad.
      
      This patch adds a block driver callback to inactivate images on the
      source before completing the migration. Inactivation means that it goes
      to a state as if it was just live migrated to the qemu instance on the
      source (i.e. BDRV_O_INACTIVE is set). You're then supposed to continue
      either on the source or on the destination, which takes ownership of the
      image.
      
      A typical migration looks like this now with respect to disk images:
      
      1. Destination qemu is started, the image is opened with
         BDRV_O_INACTIVE. The image is fully opened on the source.
      
      2. Migration is about to complete. The source flushes the image and
         inactivates it. Now both sides have the image opened with
         BDRV_O_INACTIVE and are expecting the other side to still modify it.
      
      3. One side (the destination on success) continues and calls
         bdrv_invalidate_all() in order to take ownership of the image again.
         This removes BDRV_O_INACTIVE on the resuming side; the flag remains
         set on the other side.
      
      This ensures that the same image isn't written to by both instances
      (unless both are resumed, but then you get what you deserve). This is
      important because .bdrv_close for non-BDRV_O_INACTIVE images could write
      to the image file, which is definitely forbidden while another host is
      using the image.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      76b1c7fe
    • K
      block: Rename BDRV_O_INCOMING to BDRV_O_INACTIVE · 04c01a5c
      Kevin Wolf 提交于
      Instead of covering only the state of images on the migration
      destination before the migration is completed, the flag will also cover
      the state of images on the migration source after completion. This
      common state implies that the image is technically still open, but no
      writes will happen and any cached contents will be reloaded from disk if
      and when the image leaves this state.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      04c01a5c
  5. 08 1月, 2016 2 次提交
  6. 18 12月, 2015 4 次提交
  7. 17 12月, 2015 1 次提交
  8. 03 12月, 2015 1 次提交
  9. 12 11月, 2015 3 次提交
  10. 24 10月, 2015 5 次提交
  11. 20 10月, 2015 1 次提交
    • D
      coroutine: move into libqemuutil.a library · 10817bf0
      Daniel P. Berrange 提交于
      The coroutine files are currently referenced by the block-obj-y
      variable. The coroutine functionality though is already used by
      more than just the block code. eg migration code uses coroutine
      yield. In the future the I/O channel code will also use the
      coroutine yield functionality. Since the coroutine code is nicely
      self-contained it can be easily built as part of the libqemuutil.a
      library, making it widely available.
      
      The headers are also moved into include/qemu, instead of the
      include/block directory, since they are now part of the util
      codebase, and the impl was never in the block/ directory
      either.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10817bf0
  12. 16 10月, 2015 4 次提交
  13. 25 9月, 2015 1 次提交
  14. 14 9月, 2015 3 次提交
  15. 11 9月, 2015 1 次提交
  16. 02 9月, 2015 1 次提交
    • W
      block: more check for replaced node · e12f3784
      Wen Congyang 提交于
      We use mirror+replace to fix quorum's broken child. bs/s->common.bs
      is quorum, and to_replace is the broken child. The new child is target_bs.
      Without this patch, the replace node can be any node, and it can be
      top BDS with BB, or another quorum's child. We just check if the broken
      child is part of the quorum BDS in this patch.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      Message-id: 55A86486.1000404@cn.fujitsu.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      e12f3784
  17. 14 7月, 2015 2 次提交
  18. 02 7月, 2015 1 次提交
    • F
      block: Add bdrv_get_block_status_above · ba3f0e25
      Fam Zheng 提交于
      Like bdrv_is_allocated_above, this function follows the backing chain until seeing
      BDRV_BLOCK_ALLOCATED.  Base is not included.
      
      Reimplement bdrv_is_allocated on top.
      
      [Initialized bdrv_co_get_block_status_above() ret to 0 to silence
      mingw64 compiler warning about the unitialized variable.  assert(bs !=
      base) prevents that case but I suppose the program could be compiled
      with -DNDEBUG.
      --Stefan]
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ba3f0e25