1. 14 7月, 2020 2 次提交
    • K
      qemu-img map: Don't limit block status request size · d0ceea88
      Kevin Wolf 提交于
      Limiting each loop iteration of qemu-img map to 1 GB was arbitrary from
      the beginning, though it only cut the maximum in half then because the
      interface was a signed 32 bit byte count. These days, bdrv_block_status
      supports a 64 bit byte count, so the arbitrary limit is even worse.
      
      On file-posix, bdrv_block_status() eventually maps to SEEK_HOLE and
      SEEK_DATA, which don't support a limit, but always do all of the work
      necessary to find the start of the next hole/data. Much of this work may
      be repeated if we don't use this information fully, but query with an
      only slightly larger offset in the next loop iteration. Therefore, if
      bdrv_block_status() is called in a loop, it should always pass the
      full number of bytes that the whole loop is interested in.
      
      This removes the arbitrary limit and speeds up 'qemu-img map'
      significantly on heavily fragmented images.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Message-Id: <20200707144629.51235-1-kwolf@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      d0ceea88
    • M
      iotests: Simplify _filter_img_create() a bit · 4b196cd1
      Max Reitz 提交于
      Not only is it a bit stupid to try to filter multi-line "Formatting"
      output (because we only need it for a single test, which can easily be
      amended to no longer need it), it is also problematic when there can be
      output after a "Formatting" line that we do not want to filter as if it
      were part of it.
      
      So rename _filter_img_create to _do_filter_img_create, let it filter
      only a single line, and let _filter_img_create loop over all input
      lines, calling _do_filter_img_create only on those that match
      /^Formatting/ (basically, what _filter_img_create_in_qmp did already).
      (And fix 020 to work with that.)
      Reported-by: NKevin Wolf <kwolf@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-Id: <20200709110205.310942-1-mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4b196cd1
  2. 13 7月, 2020 38 次提交