1. 09 7月, 2014 2 次提交
    • K
      block: Fix bdrv_is_allocated() return value · 01fb2705
      Kevin Wolf 提交于
      bdrv_is_allocated() should return either 0 or 1 in successful cases.
      We're lucky that currently, the callers that rely on this (e.g. because
      they check for ret == 1) don't seem to break badly. They just might skip
      some optimisation or in the case of qemu-io 'map' print separate lines
      where a single line would suffice. In theory, a wrong allocation status
      could lead to image corruption with certain operations, so let's fix
      this quickly.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      01fb2705
    • K
      block/backup: Fix hang for unaligned image size · d40593dd
      Kevin Wolf 提交于
      When doing a block backup of an image with an unaligned size (with
      respect to the BACKUP_CLUSTER_SIZE), qemu would check the allocation
      status of sectors after the end of the image. bdrv_is_allocated()
      returns a result that is valid for 0 sectors in this case, so the backup
      job ran into an endless loop.
      
      Stop looping when seeing a result valid for 0 sectors, we're at EOF then.
      
      The test case looks somewhat unrelated at first sight because I
      originally tried to reproduce a different suspected bug that turned out
      to not exist. Still a good test case and it accidentally found this one.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      d40593dd
  2. 08 7月, 2014 20 次提交
  3. 07 7月, 2014 18 次提交