Skip to content
  • Eric Blake's avatar
    087f2fb3
    qemu-io: Utilize 64-bit status during map · 087f2fb3
    Eric Blake authored
    The block layer has supported 64-bit block status from drivers since
    commit 86a3d5c6 ("block: Add .bdrv_co_block_status() callback",
    v2.12) and friends, with individual driver callbacks responsible for
    capping things where necessary.  Artificially capping things below 2G
    in the qemu-io 'map' command, added in commit d6a644bb ("block: Make
    bdrv_is_allocated() byte-based", v2.10) is thus no longer necessary.
    
    One way to test this is with qemu-nbd as server on a raw file larger
    than 4G (the entire file should show as allocated), plus 'qemu-io -f
    raw -c map nbd://localhost
    
     --trace=nbd_\*' as client.  Prior to this
    patch, the NBD_CMD_BLOCK_STATUS requests are fragmented at 0x7ffffe00
    distances; with this patch, the fragmenting changes to 0x7fffffff
    (since the NBD protocol is currently still limited to 32-bit
    transactions - see block/nbd.c:nbd_client_co_block_status).  Then in
    later patches, once I add an NBD extension for a 64-bit block status,
    the same map command completes with just one NBD_CMD_BLOCK_STATUS.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20211203231539.3900865-3-eblake@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    087f2fb3
    qemu-io: Utilize 64-bit status during map
    Eric Blake authored
    The block layer has supported 64-bit block status from drivers since
    commit 86a3d5c6 ("block: Add .bdrv_co_block_status() callback",
    v2.12) and friends, with individual driver callbacks responsible for
    capping things where necessary.  Artificially capping things below 2G
    in the qemu-io 'map' command, added in commit d6a644bb ("block: Make
    bdrv_is_allocated() byte-based", v2.10) is thus no longer necessary.
    
    One way to test this is with qemu-nbd as server on a raw file larger
    than 4G (the entire file should show as allocated), plus 'qemu-io -f
    raw -c map nbd://localhost
    
     --trace=nbd_\*' as client.  Prior to this
    patch, the NBD_CMD_BLOCK_STATUS requests are fragmented at 0x7ffffe00
    distances; with this patch, the fragmenting changes to 0x7fffffff
    (since the NBD protocol is currently still limited to 32-bit
    transactions - see block/nbd.c:nbd_client_co_block_status).  Then in
    later patches, once I add an NBD extension for a 64-bit block status,
    the same map command completes with just one NBD_CMD_BLOCK_STATUS.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <20211203231539.3900865-3-eblake@redhat.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Loading