1. 13 1月, 2012 1 次提交
  2. 05 12月, 2011 1 次提交
  3. 24 11月, 2011 1 次提交
  4. 11 11月, 2011 1 次提交
  5. 05 11月, 2011 1 次提交
  6. 04 11月, 2011 5 次提交
  7. 21 10月, 2011 3 次提交
    • 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
  8. 11 10月, 2011 3 次提交
  9. 16 9月, 2011 1 次提交
  10. 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
  11. 21 8月, 2011 1 次提交
  12. 13 1月, 2011 1 次提交
  13. 03 10月, 2010 1 次提交
  14. 21 9月, 2010 3 次提交
  15. 31 8月, 2010 1 次提交
  16. 21 5月, 2010 2 次提交
  17. 03 5月, 2010 1 次提交
    • 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
  18. 25 4月, 2010 1 次提交
  19. 23 4月, 2010 1 次提交
    • K
      Replace calls of old bdrv_open · d6e9098e
      Kevin Wolf 提交于
      What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
      callers of the old function are converted to the new one. In some places they
      even know the right format, so they should have used bdrv_open2 from the
      beginning.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d6e9098e
  20. 19 3月, 2010 1 次提交
  21. 13 3月, 2010 1 次提交
  22. 11 2月, 2010 1 次提交
    • J
      don't dereference NULL after failed strdup · 6265eb26
      Jim Meyering 提交于
      Most of these are obvious NULL-deref bug fixes, for example,
      the ones in these files:
      
        block/curl.c
        net.c
        slirp/misc.c
      
      and the first one in block/vvfat.c.
      The others in block/vvfat.c may not lead to an immediate segfault, but I
      traced the two schedule_rename(..., strdup(path)) uses, and a failed
      strdup would appear to trigger this assertion in handle_renames_and_mkdirs:
      
      	    assert(commit->path);
      
      The conversion to use qemu_strdup in envlist_to_environ is not technically
      needed, but does avoid a theoretical leak in the caller when strdup fails
      for one value, but later succeeds in allocating another buffer(plausible,
      if one string length is much larger than the others).  The caller does
      not know the length of the returned list, and as such can only free
      pointers until it hits the first NULL.  If there are non-NULL pointers
      beyond the first, their buffers would be leaked.  This one is admittedly
      far-fetched.
      
      The two in linux-user/main.c are worth fixing to ensure that an
      OOM error is diagnosed up front, rather than letting it provoke some
      harder-to-diagnose secondary error, in case of exec failure, or worse, in
      case the exec succeeds but with an invalid list of command line options.
      However, considering how unlikely it is to encounter a failed strdup early
      in main, this isn't a big deal.  Note that adding the required uses of
      qemu_strdup here and in envlist.c induce link failures because qemu_strdup
      is not currently in any library they're linked with.  So for now, I've
      omitted those changes, as well as the fixes in target-i386/helper.c
      and target-sparc/helper.c.
      
      If you'd like to see the above discussion (or anything else)
      in the commit log, just let me know and I'll be happy to adjust.
      
      >From 9af42864fd1ea666bd25e2cecfdfae74c20aa8c7 Mon Sep 17 00:00:00 2001
      From: Jim Meyering <meyering@redhat.com>
      Date: Mon, 8 Feb 2010 18:29:29 +0100
      Subject: [PATCH] don't dereference NULL after failed strdup
      
      Handle failing strdup by replacing each use with qemu_strdup,
      so as not to dereference NULL or trigger a failing assertion.
      * block/curl.c (curl_open): s/\bstrdup\b/qemu_strdup/
      * block/vvfat.c (init_directories): Likewise.
      (get_cluster_count_for_direntry, check_directory_consistency): Likewise.
      * net.c (parse_host_src_port): Likewise.
      * slirp/misc.c (fork_exec): Likewise.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      6265eb26
  23. 27 1月, 2010 2 次提交
  24. 02 10月, 2009 2 次提交
  25. 01 10月, 2009 1 次提交
  26. 28 5月, 2009 1 次提交
  27. 27 5月, 2009 1 次提交