1. 21 9月, 2010 2 次提交
    • K
      qcow2: Avoid bounce buffers for AIO write requests · 6f5f060b
      Kevin Wolf 提交于
      qcow2 used to use bounce buffers for any AIO requests. This does not only imply
      unnecessary copying, but also unbounded allocations which should be avoided.
      
      This patch removes bounce buffers from the normal AIO write path. Encrypted
      images continue to use a bounce buffer, however with constant size.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6f5f060b
    • K
      qcow2: Avoid bounce buffers for AIO read requests · bd28f835
      Kevin Wolf 提交于
      qcow2 used to use bounce buffers for any AIO requests. This does not only imply
      unnecessary copying, but also unbounded allocations which should be avoided.
      
      This patch removes bounce buffers from the normal AIO read path, and constrains
      them to a constant size for encrypted images.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      bd28f835
  2. 06 7月, 2010 1 次提交
  3. 02 7月, 2010 1 次提交
  4. 22 6月, 2010 1 次提交
  5. 28 5月, 2010 1 次提交
    • K
      qcow2: Allow qcow2_get_cluster_offset to return errors · 1c46efaa
      Kevin Wolf 提交于
      qcow2_get_cluster_offset() looks up a given virtual disk offset and returns the
      offset of the corresponding cluster in the image file. Errors (e.g. L2 table
      can't be read) are currenctly indicated by a return value of 0, which is
      unfortuately the same as for any unallocated cluster. So in effect we can't
      check for errors.
      
      This makes the old return value a by-reference parameter and returns the usual
      0/-errno error code.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1c46efaa
  6. 22 5月, 2010 1 次提交
  7. 17 5月, 2010 1 次提交
  8. 08 5月, 2010 2 次提交
  9. 03 5月, 2010 2 次提交
    • S
      qcow2: Implement bdrv_truncate() for growing images · 419b19d9
      Stefan Hajnoczi 提交于
      This patch adds the ability to grow qcow2 images in-place using
      bdrv_truncate().  This enables qemu-img resize command support for
      qcow2.
      
      Snapshots are not supported and bdrv_truncate() will return -ENOTSUP.
      The notion of resizing an image with snapshots could lead to confusion:
      users may expect snapshots to remain unchanged, but this is not possible
      with the current qcow2 on-disk format where the header.size field is
      global instead of per-snapshot.  Others may expect snapshots to change
      size along with the current image data.  I think it is safest to not
      support snapshots and perhaps add behavior later if there is a
      consensus.
      
      Backing images continue to work.  If the image is now larger than its
      backing image, zeroes are read when accessing beyond the end of the
      backing image.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      419b19d9
    • K
      block: Open the underlying image file in generic code · 66f82cee
      Kevin Wolf 提交于
      Format drivers shouldn't need to bother with things like file names, but rather
      just get an open BlockDriverState for the underlying protocol. This patch
      introduces this behaviour for bdrv_open implementation. For protocols which
      need to access the filename to open their file/device/connection/... a new
      callback bdrv_file_open is introduced which doesn't get an underlying file
      opened.
      
      For now, also some of the more obscure formats use bdrv_file_open because they
      open() the file themselves instead of using the block.c functions. They need to
      be fixed in later patches.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      66f82cee
  10. 24 4月, 2010 1 次提交
  11. 23 4月, 2010 4 次提交
  12. 10 4月, 2010 2 次提交
  13. 10 3月, 2010 1 次提交
  14. 24 2月, 2010 1 次提交
  15. 27 1月, 2010 5 次提交
  16. 14 1月, 2010 2 次提交
  17. 04 12月, 2009 1 次提交
  18. 09 11月, 2009 1 次提交
  19. 28 10月, 2009 1 次提交
  20. 15 10月, 2009 1 次提交
    • K
      qcow2: Bring synchronous read/write back to life · ef845c3b
      Kevin Wolf 提交于
      When the synchronous read and write functions were dropped, they were replaced
      by generic emulation functions. Unfortunately, these emulation functions don't
      provide the same semantics as the original functions did.
      
      The original bdrv_read would mean that we read some data synchronously and that
      we won't be interrupted during this read. The latter assumption is no longer
      true with the emulation function which needs to use qemu_aio_poll and therefore
      allows the callback of any other concurrent AIO request to be run during the
      read. Which in turn means that (meta)data read earlier could have changed and
      be invalid now. qcow2 is not prepared to work in this way and it's just scary
      how many places there are where other requests could run.
      
      I'm not sure yet where exactly it breaks, but you'll see breakage with virtio
      on qcow2 with a backing file. Providing synchronous functions again fixes the
      problem for me.
      
      Patchworks-ID: 35437
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ef845c3b
  21. 12 9月, 2009 1 次提交
    • B
      Fix sys-queue.h conflict for good · 72cf2d4f
      Blue Swirl 提交于
      Problem: Our file sys-queue.h is a copy of the BSD file, but there are
      some additions and it's not entirely compatible. Because of that, there have
      been conflicts with system headers on BSD systems. Some hacks have been
      introduced in the commits 15cc9235,
      f40d7537,
      96555a96 and
      3990d09a but the fixes were fragile.
      
      Solution: Avoid the conflict entirely by renaming the functions and the
      file. Revert the previous hacks.
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      72cf2d4f
  22. 10 9月, 2009 2 次提交
    • K
      qcow2: Order concurrent AIO requests on the same unallocated cluster · f214978a
      Kevin Wolf 提交于
      When two AIO requests write to the same cluster, and this cluster is
      unallocated, currently both requests allocate a new cluster and the second one
      merges the first one when it is completed. This means an cluster allocation, a
      read and a cluster deallocation which cause some overhead. If we simply let the
      second request wait until the first one is done, we improve overall performance
      with AIO requests (specifially, qcow2/virtio combinations).
      
      This patch maintains a list of in-flight requests that have allocated new
      clusters. A second request touching the same cluster is limited so that it
      either doesn't touch the allocation of the first request (so it can have a
      non-overlapping allocation) or it waits for the first request to complete.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      f214978a
    • K
      qcow2: Fix metadata preallocation · ea80b906
      Kevin Wolf 提交于
      The wrong version of the preallocation patch has been applied, so this is the
      remaining diff.
      
      We can't use truncate to grow the image file to the right size because we don't
      know if metadata has been written after the last data cluster. In this case
      truncate would shrink the file and destroy its metadata. Write a zero sector at
      the end of the virtual disk instead to ensure that the file is big enough.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      ea80b906
  23. 29 8月, 2009 1 次提交
  24. 28 8月, 2009 1 次提交
    • K
      qcow2: Metadata preallocation · a35e1c17
      Kevin Wolf 提交于
      This introduces a qemu-img create option for qcow2 which allows the metadata to
      be preallocated, i.e. clusters are reserved in the refcount table and L1/L2
      tables, but no data is written to them. Metadata is quite small, so this
      happens in almost no time.
      
      Especially with qcow2 on virtio this helps to gain a bit of performance during
      the initial writes. However, as soon as create a snapshot, we're back to the
      normal slow speed, obviously. So this isn't the real fix, but kind of a cheat
      while we're still having trouble with qcow2 on virtio.
      
      Note that the option is disabled by default and needs to be specified
      explicitly using qemu-img create -f qcow2 -o preallocation=metadata.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      a35e1c17
  25. 16 7月, 2009 1 次提交
  26. 11 7月, 2009 1 次提交
  27. 10 7月, 2009 1 次提交