1. 28 10月, 2017 1 次提交
    • P
      Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2017-10-26-tag' into staging · 953e35f6
      Peter Maydell 提交于
      qemu-ga patch queue for 2.11
      
      * support for network interface stats
      * w32: improvements for guest-set-time
      * w32: fix a hang with guest-fsfreeze-freeze when timeout occurs
        during heavy I/O
      * w32: fix faulty error-handling in VSS/fsfreeze COM registration
      
      # gpg: Signature made Fri 27 Oct 2017 02:11:53 BST
      # gpg:                using RSA key 0x3353C9CEF108B584
      # gpg: Good signature from "Michael Roth <flukshun@gmail.com>"
      # gpg:                 aka "Michael Roth <mdroth@utexas.edu>"
      # gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>"
      # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D  3FA0 3353 C9CE F108 B584
      
      * remotes/mdroth/tags/qga-pull-2017-10-26-tag:
        qga-win: fix error-handling in getNameByStringSID()
        qga: add network stats to guest-network-get-interfaces
        qga-win: Updating guest_set_time action
        qga-win: don't hang if vss hold writes timeout
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      953e35f6
  2. 27 10月, 2017 8 次提交
  3. 26 10月, 2017 31 次提交
    • K
      Merge remote-tracking branch 'mreitz/tags/pull-block-2017-10-26' into queue-block · 4254d01c
      Kevin Wolf 提交于
      Block patches
      
      # gpg: Signature made Thu Oct 26 15:01:20 2017 CEST
      # gpg:                using RSA key F407DB0061D5CF40
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>"
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      
      * mreitz/tags/pull-block-2017-10-26:
        iotests: Add cluster_size=64k to 125
        qcow2: Always execute preallocate() in a coroutine
        qcow2: Fix unaligned preallocated truncation
        qcow2: Emit errp when truncating the image tail
        iotests: Filter actual image size in 184 and 191
        iotests: Pull _filter_actual_image_size from 67/87
        iotests: Add test for dataplane mirroring
        qcow2: Use BDRV_SECTOR_BITS instead of its literal value
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4254d01c
    • M
      iotests: Add cluster_size=64k to 125 · 4c112a39
      Max Reitz 提交于
      Apparently it would be a good idea to test that, too.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171009215533.12530-4-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      4c112a39
    • M
      qcow2: Always execute preallocate() in a coroutine · 572b07be
      Max Reitz 提交于
      Some qcow2 functions (at least perform_cow()) expect s->lock to be
      taken.  Therefore, if we want to make use of them, we should execute
      preallocate() (as "preallocate_co") in a coroutine so that we can use
      the qemu_co_mutex_* functions.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171009215533.12530-3-mreitz@redhat.com
      Cc: qemu-stable@nongnu.org
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      572b07be
    • M
      qcow2: Fix unaligned preallocated truncation · e400ad1e
      Max Reitz 提交于
      A qcow2 image file's length is not required to have a length that is a
      multiple of the cluster size.  However, qcow2_refcount_area() expects an
      aligned value for its @start_offset parameter, so we need to round
      @old_file_size up to the next cluster boundary.
      Reported-by: NPing Li <pingl@redhat.com>
      Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1414049Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171009215533.12530-2-mreitz@redhat.com
      Cc: qemu-stable@nongnu.org
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      e400ad1e
    • M
      qcow2: Emit errp when truncating the image tail · 233521b1
      Max Reitz 提交于
      bdrv_truncate() has an errp parameter which is always set when an error
      occurs.  Let's use that instead of a plain strerror().
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171009155431.14093-1-mreitz@redhat.com
      Reviewed-by: NPavel Butsykin <pbutsykin@virtuozzo.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      233521b1
    • M
      iotests: Filter actual image size in 184 and 191 · b66df843
      Max Reitz 提交于
      Whenever the actual image size is not part of the test, it should be
      filtered as it depends on the host filesystem.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171009163456.485-3-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      b66df843
    • M
      iotests: Pull _filter_actual_image_size from 67/87 · 44673a0b
      Max Reitz 提交于
      Tests 067 and 087 filter the actual image size because it depends on the
      host filesystem (and is not part of the respective test).  Since this is
      generally true, we should have a common filter function for this, so
      let's pull out the sed line from both tests into such a function.
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20171009163456.485-2-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      44673a0b
    • M
      iotests: Add test for dataplane mirroring · f700ceae
      Max Reitz 提交于
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-id: 20170929170843.3711-1-mreitz@redhat.com
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      f700ceae
    • A
      qcow2: Use BDRV_SECTOR_BITS instead of its literal value · a35f87f5
      Alberto Garcia 提交于
      BDRV_SECTOR_BITS is defined to be 9 in block.h (and BDRV_SECTOR_SIZE
      is calculated from that), but there are still a couple of places where
      we are using the literal value instead of the macro.
      Signed-off-by: NAlberto Garcia <berto@igalia.com>
      Message-id: 20171009153856.20387-1-berto@igalia.com
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      a35f87f5
    • M
      qemu-img.1: Image invalidation on qemu-img commit · 67e56472
      Max Reitz 提交于
      qemu-img commit invalidates all images between base and top.  This
      should be mentioned in the man page.
      Suggested-by: NPing Li <pingl@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      67e56472
    • E
      qemu-io: Relax 'alloc' now that block-status doesn't assert · f0a9c18f
      Eric Blake 提交于
      Previously, the alloc command required that input parameters be
      sector-aligned and clamped to 32 bits, because the underlying
      bdrv_is_allocated used a 32-bit parameter and asserted aligned
      inputs.  But now that we have fixed block status to report a
      64-bit bytes value, and to properly round requests on behalf of
      guests, we can pass any values, and can use qemu-io to add
      coverage that our rounding is correct regardless of the guest
      alignment constraints.
      
      Update iotest 177 to intentionally probe block status at
      unaligned boundaries as well as with a bytes value that does not
      map to 32-bit sectors, which also required tweaking the image
      prep to leave an unallocated portion to the image under test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f0a9c18f
    • E
      qcow2: Reduce is_zero() rounding · 8cbf74b2
      Eric Blake 提交于
      Now that bdrv_is_allocated accepts non-aligned inputs, we can
      remove the TODO added in earlier refactoring.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      8cbf74b2
    • E
      block: Reduce bdrv_aligned_preadv() rounding · 88e63df2
      Eric Blake 提交于
      Now that bdrv_is_allocated accepts non-aligned inputs, we can
      remove the TODO added in commit d6a644bb.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      88e63df2
    • E
      block: Align block status requests · efa6e2ed
      Eric Blake 提交于
      Any device that has request_alignment greater than 512 should be
      unable to report status at a finer granularity; it may also be
      simpler for such devices to be guaranteed that the block layer
      has rounded things out to the granularity boundary (the way the
      block layer already rounds all other I/O out).  Besides, getting
      the code correct for super-sector alignment also benefits us
      for the fact that our public interface now has byte granularity,
      even though none of our drivers have byte-level callbacks.
      
      Add an assertion in blkdebug that proves that the block layer
      never requests status of unaligned sections, similar to what it
      does on other requests (while still keeping the generic helper
      in place for when future patches add a throttle driver).  Note
      that iotest 177 already covers this (it would fail if you use
      just the blkdebug.c hunk without the io.c changes).  Meanwhile,
      we can drop assertions in callers that no longer have to pass
      in sector-aligned addresses.
      
      There is a mid-function scope added for 'count' and 'longret',
      for a couple of reasons: first, an upcoming patch will add an
      'if' statement that checks whether a driver has an old- or
      new-style callback, and can conveniently use the same scope for
      less indentation churn at that time.  Second, since we are
      trying to get rid of sector-based computations, wrapping things
      in a scope makes it easier to group and see what will be
      deleted in a final cleanup patch once all drivers have been
      converted to the new-style callback.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      efa6e2ed
    • E
      qemu-img: Change img_compare() to be byte-based · 033d9fc2
      Eric Blake 提交于
      In the continuing quest to make more things byte-based, change
      the internal iteration of img_compare().  We can finally drop the
      TODO assertions added earlier, now that the entire algorithm is
      byte-based and no longer has to shift from bytes to sectors.
      
      Most of the change is mechanical ('total_sectors' becomes
      'total_size', 'sector_num' becomes 'offset', 'nb_sectors' becomes
      'chunk', 'progress_base' goes from sectors to bytes); some of it
      is also a cleanup (sectors_to_bytes() is now unused, loss of
      variable 'count' added earlier in commit 51b0a488).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      033d9fc2
    • E
      qemu-img: Change img_rebase() to be byte-based · 41536287
      Eric Blake 提交于
      In the continuing quest to make more things byte-based, change
      the internal iteration of img_rebase().  We can finally drop the
      TODO assertion added earlier, now that the entire algorithm is
      byte-based and no longer has to shift from bytes to sectors.
      
      Most of the change is mechanical ('num_sectors' becomes 'size',
      'sector' becomes 'offset', 'n' goes from sectors to bytes); some
      of it is also a cleanup (use of MIN() instead of open-coding,
      loss of variable 'count' added earlier in commit d6a644bb).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      41536287
    • E
      qemu-img: Change compare_sectors() to be byte-based · dc61cd3b
      Eric Blake 提交于
      In the continuing quest to make more things byte-based, change
      compare_sectors(), renaming it to compare_buffers() in the
      process.  Note that one caller (qemu-img compare) only cares
      about the first difference, while the other (qemu-img rebase)
      cares about how many consecutive sectors have the same
      equal/different status; however, this patch does not bother to
      micro-optimize the compare case to avoid the comparisons of
      sectors beyond the first mismatch.  Both callers are always
      passing valid buffers in, so the initial check for buffer size
      can be turned into an assertion.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      dc61cd3b
    • E
      qemu-img: Change check_empty_sectors() to byte-based · c41508ed
      Eric Blake 提交于
      Continue on the quest to make more things byte-based instead of
      sector-based.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      c41508ed
    • E
      qemu-img: Drop redundant error message in compare · 0608e40e
      Eric Blake 提交于
      If a read error is encountered during 'qemu-img compare', we
      were printing the "Error while reading offset ..." message twice;
      this was because our helper function was awkward, printing output
      on some but not all paths.  Fix it to consistently report errors
      on all paths, so that the callers do not risk a redundant message,
      and update the testsuite for the improved output.
      
      Further simplify the code by hoisting the conversion from an error
      message to an exit code into the helper function, rather than
      repeating that logic at all callers (yes, the helper function is
      now less generic, but it's a net win in lines of code).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      0608e40e
    • E
      qemu-img: Add find_nonzero() · debb38a4
      Eric Blake 提交于
      During 'qemu-img compare', when we are checking that an allocated
      portion of one file is all zeros, we don't need to waste time
      computing how many additional sectors after the first non-zero
      byte are also non-zero.  Create a new helper find_nonzero() to do
      the check for a first non-zero sector, and rebase
      check_empty_sectors() to use it.
      
      The new interface intentionally uses bytes in its interface, even
      though it still crawls the buffer a sector at a time; it is robust
      to a partial sector at the end of the buffer.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      debb38a4
    • E
      qemu-img: Speed up compare on pre-allocated larger file · 391cb1aa
      Eric Blake 提交于
      Compare the following images with all-zero contents:
      $ truncate --size 1M A
      $ qemu-img create -f qcow2 -o preallocation=off B 1G
      $ qemu-img create -f qcow2 -o preallocation=metadata C 1G
      
      On my machine, the difference is noticeable for pre-patch speeds,
      with more than an order of magnitude in difference caused by the
      choice of preallocation in the qcow2 file:
      
      $ time ./qemu-img compare -f raw -F qcow2 A B
      Warning: Image size mismatch!
      Images are identical.
      
      real	0m0.014s
      user	0m0.007s
      sys	0m0.007s
      
      $ time ./qemu-img compare -f raw -F qcow2 A C
      Warning: Image size mismatch!
      Images are identical.
      
      real	0m0.341s
      user	0m0.144s
      sys	0m0.188s
      
      Why? Because bdrv_is_allocated() returns false for image B but
      true for image C, throwing away the fact that both images know
      via lseek(SEEK_HOLE) that the entire image still reads as zero.
      From there, qemu-img ends up calling bdrv_pread() for every byte
      of the tail, instead of quickly looking for the next allocation.
      The solution: use block_status instead of is_allocated, giving:
      
      $ time ./qemu-img compare -f raw -F qcow2 A C
      Warning: Image size mismatch!
      Images are identical.
      
      real	0m0.014s
      user	0m0.011s
      sys	0m0.003s
      
      which is on par with the speeds for no pre-allocation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      391cb1aa
    • E
      qemu-img: Simplify logic in img_compare() · 7daddc61
      Eric Blake 提交于
      As long as we are querying the status for a chunk smaller than
      the known image size, we are guaranteed that a successful return
      will have set pnum to a non-zero size (pnum is zero only for
      queries beyond the end of the file).  Use that to slightly
      simplify the calculation of the current chunk size being compared.
      Likewise, we don't have to shrink the amount of data operated on
      until we know we have to read the file, and therefore have to fit
      in the bounds of our buffer.  Also, note that 'total_sectors_over'
      is equivalent to 'progress_base'.
      
      With these changes in place, sectors_to_process() is now dead code,
      and can be removed.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7daddc61
    • E
      block: Convert bdrv_get_block_status_above() to bytes · 31826642
      Eric Blake 提交于
      We are gradually moving away from sector-based interfaces, towards
      byte-based.  In the common case, allocation is unlikely to ever use
      values that are not naturally sector-aligned, but it is possible
      that byte-based values will let us be more precise about allocation
      at the end of an unaligned file that can do byte-based access.
      
      Changing the name of the function from bdrv_get_block_status_above()
      to bdrv_block_status_above() ensures that the compiler enforces that
      all callers are updated.  Likewise, since it a byte interface allows
      an offset mapping that might not be sector aligned, split the mapping
      out of the return value and into a pass-by-reference parameter.  For
      now, the io.c layer still assert()s that all uses are sector-aligned,
      but that can be relaxed when a later patch implements byte-based
      block status in the drivers.
      
      For the most part this patch is just the addition of scaling at the
      callers followed by inverse scaling at bdrv_block_status(), plus
      updates for the new split return interface.  But some code,
      particularly bdrv_block_status(), gets a lot simpler because it no
      longer has to mess with sectors.  Likewise, mirror code no longer
      computes s->granularity >> BDRV_SECTOR_BITS, and can therefore drop
      an assertion about alignment because the loop no longer depends on
      alignment (never mind that we don't really have a driver that
      reports sub-sector alignments, so it's not really possible to test
      the effect of sub-sector mirroring).  Fix a neighboring assertion to
      use is_power_of_2 while there.
      
      For ease of review, bdrv_get_block_status() was tackled separately.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      31826642
    • E
      block: Switch bdrv_co_get_block_status_above() to byte-based · 5b648c67
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Convert another internal
      type (no semantic change), and rename it to match the corresponding
      public function rename.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5b648c67
    • E
      block: Switch bdrv_common_block_status_above() to byte-based · 7ddb99b9
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Convert another internal
      function (no semantic change).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7ddb99b9
    • E
      block: Switch BdrvCoGetBlockStatusData to byte-based · 4bcd936e
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Convert another internal
      type (no semantic change), and rename it to match the corresponding
      public function rename.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4bcd936e
    • E
      block: Switch bdrv_co_get_block_status() to byte-based · 2e8bc787
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Convert another internal
      function (no semantic change); and as with its public counterpart,
      rename to bdrv_co_block_status() and split the offset return, to
      make the compiler enforce that we catch all uses.  For now, we
      assert that callers and the return value still use aligned data,
      but ultimately, this will be the function where we hand off to a
      byte-based driver callback, and will eventually need to add logic
      to ensure we round calls according to the driver's
      request_alignment then touch up the result handed back to the
      caller, to start permitting a caller to pass unaligned offsets.
      
      Note that we are now prepared to accepts 'bytes' larger than INT_MAX;
      this is okay as long as we clamp things internally before violating
      any 32-bit limits, and makes no difference to how a client will
      use the information (clients looping over the entire file must
      already be prepared for consecutive calls to return the same status,
      as drivers are already free to return shorter-than-maximal status
      due to any other convenient split points, such as when the L2 table
      crosses cluster boundaries in qcow2).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      2e8bc787
    • E
      block: Convert bdrv_get_block_status() to bytes · 237d78f8
      Eric Blake 提交于
      We are gradually moving away from sector-based interfaces, towards
      byte-based.  In the common case, allocation is unlikely to ever use
      values that are not naturally sector-aligned, but it is possible
      that byte-based values will let us be more precise about allocation
      at the end of an unaligned file that can do byte-based access.
      
      Changing the name of the function from bdrv_get_block_status() to
      bdrv_block_status() ensures that the compiler enforces that all
      callers are updated.  For now, the io.c layer still assert()s that
      all callers are sector-aligned, but that can be relaxed when a later
      patch implements byte-based block status in the drivers.
      
      There was an inherent limitation in returning the offset via the
      return value: we only have room for BDRV_BLOCK_OFFSET_MASK bits, which
      means an offset can only be mapped for sector-aligned queries (or,
      if we declare that non-aligned input is at the same relative position
      modulo 512 of the answer), so the new interface also changes things to
      return the offset via output through a parameter by reference rather
      than mashed into the return value.  We'll have some glue code that
      munges between the two styles until we finish converting all uses.
      
      For the most part this patch is just the addition of scaling at the
      callers followed by inverse scaling at bdrv_block_status(), coupled
      with the tweak in calling convention.  But some code, particularly
      bdrv_is_allocated(), gets a lot simpler because it no longer has to
      mess with sectors.
      
      For ease of review, bdrv_get_block_status_above() will be tackled
      separately.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      237d78f8
    • E
      qemu-img: Switch get_block_status() to byte-based · 5e344dd8
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Continue by converting
      an internal function (no semantic change), and simplifying its
      caller accordingly.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      5e344dd8
    • E
      block: Switch bdrv_make_zero() to byte-based · 7286d610
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Change the internal
      loop iteration of zeroing a device to track by bytes instead of
      sectors (although we are still guaranteed that we iterate by steps
      that are sector-aligned).
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      7286d610
    • E
      qcow2: Switch is_zero_sectors() to byte-based · f06f6b66
      Eric Blake 提交于
      We are gradually converting to byte-based interfaces, as they are
      easier to reason about than sector-based.  Convert another internal
      function (no semantic change), and rename it to is_zero() in the
      process.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      f06f6b66