1. 04 6月, 2014 1 次提交
    • S
      qed: use BlockDriverState's AioContext · a8c868c3
      Stefan Hajnoczi 提交于
      Drop the assumption that we're using the main AioContext.  Convert
      qemu_bh_new() to aio_bh_new() and qemu_aio_wait() to aio_poll() so we're
      using the BlockDriverState's AioContext.
      
      Implement .bdrv_detach/attach_aio_context() interfaces to move the
      QED_F_NEED_CHECK timer from the old AioContext to the new one.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      a8c868c3
  2. 22 4月, 2014 1 次提交
  3. 19 3月, 2014 1 次提交
  4. 13 3月, 2014 1 次提交
    • K
      block: Update image size in bdrv_invalidate_cache() · 3456a8d1
      Kevin Wolf 提交于
      After migration has completed, we call bdrv_invalidate_cache() so that
      drivers which cache some data drop their stale copy of the data and
      reread it from the image file to get a new version of data that the
      source modified while the migration was running.
      
      Reloading metadata from the image file is useless, though, if the size
      of the image file stays stale (this is a value that is cached for all
      image formats in block.c). Reads from (meta)data after the old EOF
      return only zeroes, causing image corruption.
      
      We need to update bs->total_sectors in all layers that could potentially
      have changed their size (i.e. backing files are not a concern - if they
      are changed, we're in bigger trouble)
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3456a8d1
  5. 22 2月, 2014 3 次提交
  6. 01 2月, 2014 1 次提交
  7. 25 1月, 2014 1 次提交
  8. 22 1月, 2014 1 次提交
  9. 03 12月, 2013 2 次提交
  10. 28 11月, 2013 1 次提交
  11. 12 9月, 2013 4 次提交
  12. 06 9月, 2013 3 次提交
  13. 23 8月, 2013 1 次提交
  14. 28 6月, 2013 1 次提交
    • P
      block: change default of .has_zero_init to 0 · 3ac21627
      Peter Lieven 提交于
      .has_zero_init defaults to 1 for all formats and protocols.
      
      this is a dangerous default since this means that all
      new added drivers need to manually overwrite it to 0 if
      they do not ensure that a device is zero initialized
      after bdrv_create().
      
      if a driver needs to explicitly set this value to
      1 its easier to verify the correctness in the review process.
      
      during review of the existing drivers it turned out
      that ssh and gluster had a wrong default of 1.
      both protocols support host_devices as backend
      which are not by default zero initialized. this
      wrong assumption will lead to possible corruption
      if qemu-img convert is used to write to such a backend.
      
      vpc and vmdk also defaulted to 1 altough they support
      fixed respectively flat extends. this has to be addresses
      in separate patches. both formats as well as the mentioned
      ssh and gluster are turned to the default of 0 with this
      patch for safety.
      
      a similar problem with the wrong default existed for
      iscsi most likely because the driver developer did
      oversee the default value of 1.
      Signed-off-by: NPeter Lieven <pl@kamp.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      3ac21627
  15. 23 3月, 2013 1 次提交
  16. 15 3月, 2013 1 次提交
  17. 26 1月, 2013 1 次提交
  18. 19 12月, 2012 3 次提交
  19. 15 11月, 2012 1 次提交
  20. 24 9月, 2012 1 次提交
  21. 29 8月, 2012 1 次提交
  22. 10 8月, 2012 2 次提交
  23. 09 7月, 2012 1 次提交
  24. 15 6月, 2012 1 次提交
    • K
      qemu-img check -r for repairing images · 4534ff54
      Kevin Wolf 提交于
      The QED block driver already provides the functionality to not only
      detect inconsistencies in images, but also fix them. However, this
      functionality cannot be manually invoked with qemu-img, but the
      check happens only automatically during bdrv_open().
      
      This adds a -r switch to qemu-img check that allows manual invocation
      of an image repair.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4534ff54
  25. 12 6月, 2012 2 次提交
    • M
      consolidate qemu_iovec_copy() and qemu_iovec_concat() and make them consistent · 1b093c48
      Michael Tokarev 提交于
      qemu_iovec_concat() is currently a wrapper for
      qemu_iovec_copy(), use the former (with extra
      "0" arg) in a few places where it is used.
      
      Change skip argument of qemu_iovec_copy() from
      uint64_t to size_t, since size of qiov itself
      is size_t, so there's no way to skip larger
      sizes.  Rename it to soffset, to make it clear
      that the offset is applied to src.
      
      Also change the only usage of uint64_t in
      hw/9pfs/virtio-9p.c, in v9fs_init_qiov_from_pdu() -
      all callers of it actually uses size_t too,
      not uint64_t.
      
      One added restriction: as for all other iovec-related
      functions, soffset must point inside src.
      
      Order of argumens is already good:
       qemu_iovec_memset(QEMUIOVector *qiov, size_t offset,
                         int c, size_t bytes)
      vs:
       qemu_iovec_concat(QEMUIOVector *dst,
                         QEMUIOVector *src,
                         size_t soffset, size_t sbytes)
      (note soffset is after _src_ not dst, since it applies to src;
      for memset it applies to qiov).
      
      Note that in many places where this function is used,
      the previous call is qemu_iovec_reset(), which means
      many callers actually want copy (replacing dst content),
      not concat.  So we may want to add a wrapper like
      qemu_iovec_copy() with the same arguments but which
      calls qemu_iovec_reset() before _concat().
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      1b093c48
    • M
      consolidate qemu_iovec_memset{,_skip}() into single function and use existing iov_memset() · 3d9b4925
      Michael Tokarev 提交于
      This patch combines two functions into one, and replaces
      the implementation with already existing iov_memset() from
      iov.c.
      
      The new prototype of qemu_iovec_memset():
        size_t qemu_iovec_memset(qiov, size_t offset, int fillc, size_t bytes)
      It is different from former qemu_iovec_memset_skip(), and
      I want to make other functions to be consistent with it
      too: first how much to skip, second what, and 3rd how many
      of it.  It also returns actual number of bytes filled in,
      which may be less than the requested `bytes' if qiov is
      smaller than offset+bytes, in the same way iov_memset()
      does.
      
      While at it, use utility function iov_memset() from
      iov.h in posix-aio-compat.c, where qiov was used.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      3d9b4925
  26. 10 5月, 2012 1 次提交
  27. 05 4月, 2012 2 次提交