1. 09 7月, 2012 1 次提交
  2. 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
  3. 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
  4. 10 5月, 2012 1 次提交
  5. 05 4月, 2012 5 次提交
  6. 09 2月, 2012 2 次提交
    • S
      qed: add .bdrv_co_write_zeroes() support · 0e71be19
      Stefan Hajnoczi 提交于
      Zero writes are a dedicated interface for writing regions of zeroes into
      the image file.  If clusters are not yet allocated it is possible to use
      an efficient metadata representation which keeps the image file compact
      and does not store individual zero bytes.
      
      Implementing this for the QED image format is fairly straightforward.
      The only issue is that when a zero write touches an existing cluster we
      have to allocate a bounce buffer and perform a regular write.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0e71be19
    • S
      qed: replace is_write with flags field · 6e4f59bd
      Stefan Hajnoczi 提交于
      Per-request attributes like read/write are currently implemented as bool
      fields in the QEDAIOCB struct.  This becomes unwiedly as the number of
      attributes grows.  For example, the qed_aio_setup() function would have
      to take multiple bool arguments and at call sites it would be hard to
      distinguish the meaning of each bool.
      
      Instead use a flags field with bitmask constants.  This will be used
      when zero write support is added.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6e4f59bd
  7. 15 12月, 2011 1 次提交
    • P
      block: bdrv_aio_* do not return NULL · ad54ae80
      Paolo Bonzini 提交于
      Initially done with the following semantic patch:
      
      @ rule1 @
      expression E;
      statement S;
      @@
        E =
      (
         bdrv_aio_readv
      |  bdrv_aio_writev
      |  bdrv_aio_flush
      |  bdrv_aio_discard
      |  bdrv_aio_ioctl
      )
           (...);
      (
      - if (E == NULL) { ... }
      |
      - if (E)
          { <... S ...> }
      )
      
      which however missed the occurrence in block/blkverify.c
      (as it should have done), and left behind some unused
      variables.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      ad54ae80
  8. 05 12月, 2011 1 次提交
  9. 22 11月, 2011 1 次提交
  10. 26 10月, 2011 2 次提交
  11. 21 10月, 2011 1 次提交
  12. 05 10月, 2011 1 次提交
  13. 21 8月, 2011 1 次提交
  14. 02 8月, 2011 1 次提交
    • K
      async: Remove AsyncContext · 384acbf4
      Kevin Wolf 提交于
      The purpose of AsyncContexts was to protect qcow and qcow2 against reentrancy
      during an emulated bdrv_read/write (which includes a qemu_aio_wait() call and
      can run AIO callbacks of different requests if it weren't for AsyncContexts).
      
      Now both qcow and qcow2 are protected by CoMutexes and AsyncContexts can be
      removed.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      384acbf4
  15. 08 6月, 2011 1 次提交
    • K
      qemu-img create: Fix displayed default cluster size · 99cce9fa
      Kevin Wolf 提交于
      When not specifying a cluster size on the command line, qemu-img printed
      a cluster size of 0:
      
          Formatting '/tmp/test.qcow2', fmt=qcow2 size=67108864
          encryption=off cluster_size=0
      
      This patch adds the default cluster size to the QEMUOptionParameter list, so
      that it displays the default value that is used.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      99cce9fa
  16. 18 5月, 2011 2 次提交
    • S
      qed: support for growing images · 77a5a000
      Stefan Hajnoczi 提交于
      The .bdrv_truncate() operation resizes images and growing is easy to
      implement in QED.  Simply check that the new size is valid and then
      update the image_size header field to reflect the new size.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      77a5a000
    • S
      qed: Periodically flush and clear need check bit · 6f321e93
      Stefan Hajnoczi 提交于
      One strategy to limit the startup delay of consistency check when
      opening image files is to ensure that the file is marked dirty for as
      little time as possible.
      
      QED currently marks the image dirty when the first allocating write
      request is issued and clears the dirty bit again when the image is
      cleanly closed.  In practice that means the image is marked dirty for
      most of a guest's lifetime and prone to being in a dirty state upon
      crash or power failure.
      
      It is safe to clear the dirty bit after all allocating write requests
      have completed and a flush has been performed.  This patch adds a timer
      after the last allocating write request completes.  When the timer fires
      it will flush and then clear the dirty bit.  The timer is set to 5
      seconds and is cancelled upon arrival of a new allocating write request.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      6f321e93
  17. 13 4月, 2011 1 次提交
  18. 10 2月, 2011 1 次提交
  19. 31 1月, 2011 1 次提交
  20. 24 1月, 2011 1 次提交
  21. 17 12月, 2010 4 次提交