[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [Qemu-devel] [PATCH v4 17/20] vmdk: Switch to .bdrv_co_

From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v4 17/20] vmdk: Switch to .bdrv_co_block_status()
Date: Thu, 30 Nov 2017 17:18:15 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

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 <address@hidden>

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

[Prev in Thread] Current Thread [Next in Thread]