On 11/30/2017 05:39 AM, Vladimir Sementsov-Ogievskiy wrote:
12.10.2017 21:59, Eric Blake wrote:
We are gradually moving away from sector-based interfaces, towards
byte-based.  Update the vmdk driver accordingly.

Signed-off-by: Eric Blake <ebl...@redhat.com>

---
v4: rebase to interface tweak
v3: no change
v2: rebase to mapping flag
---
  block/vmdk.c | 28 +++++++++++++---------------
  1 file changed, 13 insertions(+), 15 deletions(-)

+static int coroutine_fn vmdk_co_block_status(BlockDriverState *bs,
+                                             bool want_zero,
+                                             int64_t offset, int64_t bytes, +                                             int64_t *pnum, int64_t *map,
+                                             BlockDriverState **file)
  {
      BDRVVmdkState *s = bs->opaque;
      int64_t index_in_cluster, n, ret;
-    uint64_t offset;
+    uint64_t cluster_offset;
      VmdkExtent *extent;

-    extent = find_extent(s, sector_num, NULL);
+    extent = find_extent(s, offset >> BDRV_SECTOR_BITS, NULL);
      if (!extent) {
          return 0;

Pre-existing bug - this returns 0, but did not set pnum.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to