1. 30 4月, 2014 9 次提交
    • M
      curl: Fix long line · f6246509
      Matthew Booth 提交于
      Signed-off-by: NMatthew Booth <mbooth@redhat.com>
      Tested-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f6246509
    • M
      block/vdi: Error out immediately in vdi_create() · 0549ea8b
      Max Reitz 提交于
      Currently, if an error occurs during the part of vdi_create() which
      actually writes the image, the function stores -errno, but continues
      anyway.
      
      Instead of trying to write data which (if it can be written at all) does
      not make any sense without the operations before succeeding (e.g.,
      writing the image header), just error out immediately.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0549ea8b
    • M
      block/bochs: Fix error handling for seek_to_sector() · e1b42f45
      Max Reitz 提交于
      Currently, seek_to_sector() returns -1 both for errors and unallocated
      sectors, resulting in silent errors. As 0 is an invalid offset of data
      clusters (bitmap_offset is greater than 0 because s->data_offset is
      greater than 0), just return 0 for unallocated sectors and -errno in
      case of error. This should then be propagated by bochs_read(), the sole
      user of seek_to_sector().
      
      That function also has a case of "return -1 in case of error", which is
      fixed by this patch as well.
      
      bochs_read() is called by bochs_co_read() which passes the return value
      through, therefore it is indeed correct for bochs_read() to return
      -errno.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      e1b42f45
    • M
      qcow2: Check min_size in qcow2_grow_l1_table() · b93f9950
      Max Reitz 提交于
      First, new_l1_size is an int64_t, whereas min_size is a uint64_t.
      Therefore, during the loop which adjusts new_l1_size until it equals or
      exceeds min_size, new_l1_size might overflow and become negative. The
      comparison in the loop condition however will take it as an unsigned
      value (because min_size is unsigned) and therefore recognize it as
      exceeding min_size. Therefore, the loop is left with a negative
      new_l1_size, which is not correct. This could be fixed by making
      new_l1_size uint64_t.
      
      On the other hand, however, by doing this, the while loop may take
      forever. If min_size is e.g. UINT64_MAX, it will take new_l1_size
      probably multiple overflows to reach the exact same value (if it reaches
      it at all). Then, right after the loop, new_l1_size will be recognized
      as being too big anyway.
      
      Both problems require a ridiculously high min_size value, which is very
      unlikely to occur; but both problems are also simply avoided by checking
      whether min_size is sane before calculating new_l1_size (which should
      still be checked separately, though).
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      b93f9950
    • M
      qcow2: Catch bdrv_getlength() error · a49139af
      Max Reitz 提交于
      The call to bdrv_getlength() from qcow2_check_refcounts() may result in
      an error. Check this and abort if necessary.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      a49139af
    • M
      block: Use correct width in format strings · 521b2b5d
      Max Reitz 提交于
      Instead of blindly relying on a normal integer having a width of 32 bits
      (which is a pretty good assumption, but we should not rely on it if
      there is no need), use the correct format string macros.
      
      This does not touch DEBUG output.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      521b2b5d
    • M
      qcow2: Avoid overflow in alloc_clusters_noref() · 91f827dc
      Max Reitz 提交于
      alloc_clusters_noref() stores the cluster index in a uint64_t. However,
      offsets are often represented as int64_t (as for example the return
      value of alloc_clusters_noref() itself demonstrates). Therefore, we
      should make sure all offsets in the allocated range of clusters are
      representable using int64_t without overflows.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      91f827dc
    • M
      block: Use error_abort in bdrv_image_info_specific_dump() · 35d0d40a
      Max Reitz 提交于
      Currently, bdrv_image_info_specific_dump() uses an error variable for
      visit_type_ImageInfoSpecific, but ignores the result. As this function
      is used here with an output visitor to transform the ImageInfoSpecific
      object to a generic QDict, an error should actually be impossible. It is
      however better to assert that this is indeed the case. This is done by
      this patch using error_abort instead of an unused local Error variable.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reported-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      35d0d40a
    • 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
  2. 29 4月, 2014 3 次提交
  3. 28 4月, 2014 1 次提交
  4. 26 4月, 2014 3 次提交
  5. 25 4月, 2014 1 次提交
  6. 23 4月, 2014 1 次提交
  7. 22 4月, 2014 6 次提交
  8. 11 4月, 2014 3 次提交
  9. 04 4月, 2014 3 次提交
  10. 03 4月, 2014 3 次提交
  11. 01 4月, 2014 7 次提交