vdi.c (32cc71def9e3885f9527af713e6d8dc7521ddc08) vdi.c (353a5d84b25c335b259f37c4f43dad96e6d60ba8)
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

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

725 offset = s->bmap_sector + bmap_first;
726 base = ((uint8_t *)&s->bmap[0]) + bmap_first * SECTOR_SIZE;
727 logout("will write %u block map sectors starting from entry %u\n",
728 n_sectors, bmap_first);
729 ret = bdrv_pwrite(bs->file, offset * SECTOR_SIZE,
730 n_sectors * SECTOR_SIZE, base, 0);
731 }
732
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

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

725 offset = s->bmap_sector + bmap_first;
726 base = ((uint8_t *)&s->bmap[0]) + bmap_first * SECTOR_SIZE;
727 logout("will write %u block map sectors starting from entry %u\n",
728 n_sectors, bmap_first);
729 ret = bdrv_pwrite(bs->file, offset * SECTOR_SIZE,
730 n_sectors * SECTOR_SIZE, base, 0);
731 }
732
733 return ret < 0 ? ret : 0;
733 return ret;
734}
735
736static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options,
737 size_t block_size, Error **errp)
738{
739 BlockdevCreateOptionsVdi *vdi_opts;
740 int ret = 0;
741 uint64_t bytes = 0;

--- 324 unchanged lines hidden ---
734}
735
736static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options,
737 size_t block_size, Error **errp)
738{
739 BlockdevCreateOptionsVdi *vdi_opts;
740 int ret = 0;
741 uint64_t bytes = 0;

--- 324 unchanged lines hidden ---