1. 07 3月, 2012 1 次提交
  2. 05 12月, 2011 1 次提交
  3. 24 11月, 2011 1 次提交
  4. 22 11月, 2011 1 次提交
  5. 11 11月, 2011 1 次提交
  6. 29 10月, 2011 3 次提交
  7. 26 10月, 2011 2 次提交
  8. 21 10月, 2011 6 次提交
    • P
      block: change flush to co_flush · 8b94ff85
      Paolo Bonzini 提交于
      Since coroutine operation is now mandatory, convert all bdrv_flush
      implementations to coroutines.  For qcow2, this means taking the lock.
      Other implementations are simpler and just forward bdrv_flush to the
      underlying protocol, so they can avoid the lock.
      
      The bdrv_flush callback is then unused and can be eliminated.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8b94ff85
    • P
      block: take lock around bdrv_write implementations · e183ef75
      Paolo Bonzini 提交于
      This does the first part of the conversion to coroutines, by
      wrapping bdrv_write implementations to take the mutex.
      
      Drivers that implement bdrv_write rather than bdrv_co_writev can
      then benefit from asynchronous operation (at least if the underlying
      protocol supports it, which is not the case for raw-win32), even
      though they still operate with a bounce buffer.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e183ef75
    • P
      block: take lock around bdrv_read implementations · 2914caa0
      Paolo Bonzini 提交于
      This does the first part of the conversion to coroutines, by
      wrapping bdrv_read implementations to take the mutex.
      
      Drivers that implement bdrv_read rather than bdrv_co_readv can
      then benefit from asynchronous operation (at least if the underlying
      protocol supports it, which is not the case for raw-win32), even
      though they still operate with a bounce buffer.
      
      raw-win32 does not need the lock, because it cannot yield.
      nbd also doesn't probably, but better be safe.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2914caa0
    • P
      block: add a CoMutex to synchronous read drivers · 848c66e8
      Paolo Bonzini 提交于
      The big conversion of bdrv_read/write to coroutines caused the two
      homonymous callbacks in BlockDriver to become reentrant.  It goes
      like this:
      
      1) bdrv_read is now called in a coroutine, and calls bdrv_read or
      bdrv_pread.
      
      2) the nested bdrv_read goes through the fast path in bdrv_rw_co_entry;
      
      3) in the common case when the protocol is file, bdrv_co_do_readv calls
      bdrv_co_readv_em (and from here goes to bdrv_co_io_em), which yields
      until the AIO operation is complete;
      
      4) if bdrv_read had been called from a bottom half, the main loop
      is free to iterate again: a device model or another bottom half
      can then come and call bdrv_read again.
      
      This applies to all four of read/write/flush/discard.  It would also
      apply to is_allocated, but it is not used from within coroutines:
      besides qemu-img.c and qemu-io.c, which operate synchronously, the
      only user is the monitor.  Copy-on-read will introduce a use in the
      block layer, and will require converting it.
      
      The solution is "simply" to convert all drivers to coroutines!  We
      just need to add a CoMutex that is taken around affected operations.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      848c66e8
    • P
      vmdk: clean up open · bae0a0cc
      Paolo Bonzini 提交于
      Move vmdk_parent_open to vmdk_open.  There's another path how
      vmdk_parent_open can be reached:
      
        vmdk_parse_extents() ->  vmdk_open_sparse() ->  vmdk_open_vmdk4() ->
        vmdk_open_desc_file().
      
      If that can happen, however, the code is bogus.  vmdk_parent_open
      reads from bs->file:
      
          if (bdrv_pread(bs->file, s->desc_offset, desc, DESC_SIZE) != DESC_SIZE) {
      
      but it is always called with s->desc_offset == 0 and with the same
      bs->file.  So the data that vmdk_parent_open reads comes always from the
      same place, and anyway there is only one place where it can write it,
      namely bs->backing_file.
      
      So, if it cannot happen, the patched code is okay.
      
      It is also possible that the recursive call can happen, but only once.  In
      that case there would still be a bug in vmdk_open_desc_file setting
      s->desc_offset = 0, but the patched code is okay.
      
      Finally, in the case where multiple recursive calls can happen the code
      would need to be rewritten anyway.  It is likely that this would anyway
      involve adding several parameters to vmdk_parent_open, and calling it from
      vmdk_open_vmdk4.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      bae0a0cc
    • P
      vmdk: fix return values of vmdk_parent_open · 588b65a3
      Paolo Bonzini 提交于
      While vmdk_open_desc_file (touched by the patch) correctly changed -1
      to -EINVAL, vmdk_open did not.  Fix it directly in vmdk_parent_open.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      588b65a3
  9. 20 9月, 2011 1 次提交
  10. 06 9月, 2011 8 次提交
  11. 03 9月, 2011 1 次提交
    • S
      Use new macro QEMU_PACKED for packed structures · 541dc0d4
      Stefan Weil 提交于
      Most changes were made using these commands:
      
      git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
      git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'
      git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/'
      git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/'
      git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/'
      
      Whitespace in linux-user/syscall_defs.h was fixed manually
      to avoid warnings from scripts/checkpatch.pl.
      
      Manual changes were also applied to hw/pc.c.
      
      I did not fix indentation with tabs in block/vvfat.c.
      The patch will show 4 errors with scripts/checkpatch.pl.
      Signed-off-by: NStefan Weil <weil@mail.berlios.de>
      Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
      541dc0d4
  12. 21 8月, 2011 1 次提交
  13. 19 7月, 2011 12 次提交
  14. 08 6月, 2011 1 次提交