1. 20 4月, 2012 6 次提交
    • K
      qcow2: Support reading zero clusters · 6377af48
      Kevin Wolf 提交于
      This adds support for reading zero clusters in version 3 images.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6377af48
    • K
      qcow2: Simplify count_cow_clusters · 143550a8
      Kevin Wolf 提交于
      count_cow_clusters() tries to reuse existing functions, and all it
      achieves is to make things much more complicated than they really are:
      Everything needs COW, unless it's a normal cluster with refcount 1.
      
      This patch implements the obvious way of doing this, and by using
      qcow2_get_cluster_type() it gets rid of all flag magic.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      143550a8
    • K
      qcow2: Ignore reserved bits in L1/L2 entries · 8e37f681
      Kevin Wolf 提交于
      This changes the still existing places that assume that the only flags
      are QCOW_OFLAG_COPIED and QCOW_OFLAG_COMPRESSED to properly mask out
      reserved bits.
      
      It does not convert bdrv_check yet.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8e37f681
    • K
      qcow2: Fail write_compressed when overwriting data · b0b6862e
      Kevin Wolf 提交于
      qcow2_alloc_compressed_cluster_offset() already fails if the copied flag
      is set, because qcow2_write_compressed() doesn't perform COW as it would
      have to do to allow this.
      
      However, what we really want to check here is whether the cluster is
      allocated or not. With internal snapshots the copied flag may not be set
      on allocated clusters. Check the cluster offset instead.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b0b6862e
    • K
      qcow2: Ignore reserved bits in count_contiguous_clusters() · 2bfcc4a0
      Kevin Wolf 提交于
      Until now, count_contiguous_clusters() has an argument that allowed to
      specify flags that should be ignored in the comparison, i.e. that are
      allowed to change between contiguous clusters.
      
      This patch changes the function so that it ignores all flags by default
      now and you need to pass the flags on which it should stop.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2bfcc4a0
    • K
      qcow2: Ignore reserved bits in get_cluster_offset · 68d000a3
      Kevin Wolf 提交于
      With this change, reading from a qcow2 image ignores all reserved bits
      that are set in an L1 or L2 table entry.
      
      Now get_cluster_offset() assigns *cluster_offset only the offset without
      any other flags. The cluster type is not longer encoded in the offset,
      but a positive return value in case of success.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      68d000a3
  2. 19 4月, 2012 1 次提交
  3. 05 4月, 2012 1 次提交
  4. 12 3月, 2012 3 次提交
  5. 05 12月, 2011 2 次提交
    • S
      qcow2: avoid reentrant bdrv_read() in copy_sectors() · aef4acb6
      Stefan Hajnoczi 提交于
      A BlockDriverState should not issue requests on itself through the
      public block layer interface.  Nested, or reentrant, requests are
      problematic because they do I/O throttling and request tracking twice.
      
      Features like block layer copy-on-read use request tracking to avoid
      race conditions between concurrent requests.  The reentrant request will
      have to "wait" for its parent request to complete.  But the parent is
      waiting for the reentrant request to make progress so we have reached
      deadlock.
      
      The solution is for block drivers to avoid the public block layer
      interfaces for reentrant requests.   Instead they should call their own
      internal functions if they wish to perform reentrant requests.
      
      This is also a good opportunity to make copy_sectors() a true
      coroutine_fn.  That means calling bdrv_co_writev() instead of
      bdrv_write().  Behavior is unchanged but we're being explicit that this
      executes in coroutine context.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      aef4acb6
    • K
      qcow2: Unlock during COW · 1b9f1491
      Kevin Wolf 提交于
      Unlocking during COW allows for more parallelism. One change it requires is
      that buffers are dynamically allocated instead of just using a per-image
      buffer.
      
      While touching the code, drop the synchronous qcow2_read() function and replace
      it by a bdrv_read() call.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1b9f1491
  6. 21 10月, 2011 1 次提交
  7. 12 9月, 2011 3 次提交
  8. 25 8月, 2011 1 次提交
  9. 23 8月, 2011 1 次提交
  10. 21 8月, 2011 1 次提交
  11. 02 8月, 2011 1 次提交
  12. 15 6月, 2011 1 次提交
  13. 08 6月, 2011 1 次提交
  14. 10 2月, 2011 2 次提交
  15. 31 1月, 2011 1 次提交
  16. 24 1月, 2011 3 次提交
  17. 17 12月, 2010 1 次提交
  18. 04 11月, 2010 1 次提交
  19. 22 10月, 2010 1 次提交
    • S
      qcow2: Support exact L1 table growth · 72893756
      Stefan Hajnoczi 提交于
      The L1 table grow operation includes a size calculation that bumps up
      the new L1 table size in order to anticipate the size needs of vmstate
      data.  This helps reduce the number of times that the L1 table has to be
      grown when vmstate data is appended.
      
      This size overhead is not necessary during image creation,
      bdrv_truncate(), or snapshot goto operations.  In fact, existing
      qemu-iotests that exercise table growth are no longer able to trigger it
      because image creation preallocates an L1 table that is too large after
      changes to qcow_create2().
      
      This patch keeps the size calculation but also adds exact growth for
      callers that do not want to inflate the L1 table size unnecessarily.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      72893756
  20. 21 9月, 2010 3 次提交
  21. 08 9月, 2010 1 次提交
  22. 22 6月, 2010 1 次提交
  23. 15 6月, 2010 1 次提交
  24. 28 5月, 2010 2 次提交