1. 04 6月, 2014 1 次提交
  2. 30 4月, 2014 1 次提交
    • K
      block: Unlink temporary files in raw-posix/win32 · 8bfea15d
      Kevin Wolf 提交于
      Instead of having unlink() calls in the generic block layer, where we
      aren't even guarateed to have a file name, move them to those block
      drivers that are actually used and that always have a filename. Gets us
      rid of some #ifdefs as well.
      
      The patch also converts bs->is_temporary to a new BDRV_O_TEMPORARY open
      flag so that it is inherited in the protocol layer and the raw-posix and
      raw-win32 drivers can unlink the file.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      8bfea15d
  3. 13 3月, 2014 1 次提交
  4. 06 3月, 2014 2 次提交
  5. 18 2月, 2014 1 次提交
  6. 25 1月, 2014 1 次提交
  7. 07 1月, 2014 1 次提交
  8. 14 11月, 2013 1 次提交
    • F
      block: Print its file name if backing file opening failed · b04b6b6e
      Fam Zheng 提交于
      If backing file doesn't exist, the error message is confusing and
      misleading:
      
          $ qemu /tmp/a.qcow2
          qemu: could not open disk image /tmp/a.qcow2: Could not open file: No
          such file or directory
      
      But...
      
          $ ls /tmp/a.qcow2
          /tmp/a.qcow2
      
          $ qemu-img info /tmp/a.qcow2
          image: /tmp/a.qcow2
          file format: qcow2
          virtual size: 8.0G (8589934592 bytes)
          disk size: 196K
          cluster_size: 65536
          backing file: /tmp/b.qcow2
      
      Because...
      
          $ ls /tmp/b.qcow2
          ls: cannot access /tmp/b.qcow2: No such file or directory
      
      This is not intuitive. It's better to have the missing file's name in
      the error message. With this patch:
      
          $ qemu-io -c 'read 0 512' /tmp/a.qcow2
          qemu-io: can't open device /tmp/a.qcow2: Could not open backing
          file: Could not open '/stor/vm/arch.raw': No such file or directory
          no file open, try 'help open'
      
      Which is a little bit better.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b04b6b6e
  9. 29 10月, 2013 1 次提交
    • K
      block: Avoid unecessary drv->bdrv_getlength() calls · b94a2610
      Kevin Wolf 提交于
      The block layer generally keeps the size of an image cached in
      bs->total_sectors so that it doesn't have to perform expensive
      operations to get the size whenever it needs it.
      
      This doesn't work however when using a backend that can change its size
      without qemu being aware of it, i.e. passthrough of removable media like
      CD-ROMs or floppy disks. For this reason, the caching is disabled when a
      removable device is used.
      
      It is obvious that checking whether the _guest_ device has removable
      media isn't the right thing to do when we want to know whether the size
      of the host backend can change. To make things worse, non-top-level
      BlockDriverStates never have any device attached, which makes qemu
      assume they are removable, so drv->bdrv_getlength() is always called on
      the protocol layer. In the case of raw-posix, this causes unnecessary
      lseek() system calls, which turned out to be rather expensive.
      
      This patch completely changes the logic and disables bs->total_sectors
      caching only for certain block driver types, for which a size change is
      expected: host_cdrom and host_floppy on POSIX, host_device on win32; also
      the raw format in case it sits on top of one of these protocols, but in
      the common case the nested bdrv_getlength() call on the protocol driver
      will use the cache again and avoid an expensive drv->bdrv_getlength()
      call.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      b94a2610
  10. 17 10月, 2013 1 次提交
  11. 11 10月, 2013 1 次提交
  12. 25 9月, 2013 1 次提交
  13. 12 9月, 2013 3 次提交
  14. 06 9月, 2013 1 次提交
  15. 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
  16. 22 4月, 2013 2 次提交
  17. 25 3月, 2013 1 次提交
  18. 15 3月, 2013 1 次提交
    • S
      threadpool: drop global thread pool · c4d9d196
      Stefan Hajnoczi 提交于
      Now that each AioContext has a ThreadPool and the main loop AioContext
      can be fetched with bdrv_get_aio_context(), we can eliminate the concept
      of a global thread pool from thread-pool.c.
      
      The submit functions must take a ThreadPool* argument.
      
      block/raw-posix.c and block/raw-win32.c use
      aio_get_thread_pool(bdrv_get_aio_context(bs)) to fetch the main loop's
      ThreadPool.
      
      tests/test-thread-pool.c must be updated to reflect the new
      thread_pool_submit() function prototypes.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      c4d9d196
  19. 02 1月, 2013 1 次提交
  20. 19 12月, 2012 2 次提交
  21. 11 12月, 2012 1 次提交
  22. 31 10月, 2012 2 次提交
  23. 24 9月, 2012 2 次提交
  24. 15 8月, 2012 2 次提交
  25. 11 11月, 2011 1 次提交
  26. 21 10月, 2011 1 次提交
  27. 22 8月, 2011 1 次提交
  28. 01 8月, 2011 1 次提交
  29. 19 7月, 2011 1 次提交
  30. 08 6月, 2011 1 次提交
  31. 31 1月, 2011 1 次提交
  32. 07 11月, 2010 1 次提交