vdi.c (3c9331c47f22224118d5019b0af8eac704824d8d) vdi.c (67a0fd2a9bca204d2b39f910a97c7137636a0715)
1/*
2 * Block driver for the Virtual Disk Image (VDI) format
3 *
4 * Copyright (c) 2009, 2012 Stefan Weil
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or

--- 513 unchanged lines hidden (view full) ---

522
523static int vdi_reopen_prepare(BDRVReopenState *state,
524 BlockReopenQueue *queue, Error **errp)
525{
526 return 0;
527}
528
529static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,
1/*
2 * Block driver for the Virtual Disk Image (VDI) format
3 *
4 * Copyright (c) 2009, 2012 Stefan Weil
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or

--- 513 unchanged lines hidden (view full) ---

522
523static int vdi_reopen_prepare(BDRVReopenState *state,
524 BlockReopenQueue *queue, Error **errp)
525{
526 return 0;
527}
528
529static int64_t coroutine_fn vdi_co_get_block_status(BlockDriverState *bs,
530 int64_t sector_num, int nb_sectors, int *pnum)
530 int64_t sector_num, int nb_sectors, int *pnum, BlockDriverState **file)
531{
532 /* TODO: Check for too large sector_num (in bdrv_is_allocated or here). */
533 BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
534 size_t bmap_index = sector_num / s->block_sectors;
535 size_t sector_in_block = sector_num % s->block_sectors;
536 int n_sectors = s->block_sectors - sector_in_block;
537 uint32_t bmap_entry = le32_to_cpu(s->bmap[bmap_index]);
538 uint64_t offset;

--- 378 unchanged lines hidden ---
531{
532 /* TODO: Check for too large sector_num (in bdrv_is_allocated or here). */
533 BDRVVdiState *s = (BDRVVdiState *)bs->opaque;
534 size_t bmap_index = sector_num / s->block_sectors;
535 size_t sector_in_block = sector_num % s->block_sectors;
536 int n_sectors = s->block_sectors - sector_in_block;
537 uint32_t bmap_entry = le32_to_cpu(s->bmap[bmap_index]);
538 uint64_t offset;

--- 378 unchanged lines hidden ---