VHD_SECTOR_SIZE
imgsz = image_size / VHD_SECTOR_SIZE;
geom.sectors * VHD_SECTOR_SIZE;
newsz += geom.heads * geom.sectors * VHD_SECTOR_SIZE;
_Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2,
batsz = (batsz + VHD_SECTOR_SIZE - 1) & ~(VHD_SECTOR_SIZE - 1);
sector = (sizeof(footer) + sizeof(header) + batsz) / VHD_SECTOR_SIZE;
sector += (VHD_BLOCK_SIZE / VHD_SECTOR_SIZE) + 1;
bitmap = malloc(VHD_SECTOR_SIZE);
memset(bitmap, 0xff, VHD_SECTOR_SIZE);
if (sparse_write(fd, bitmap, VHD_SECTOR_SIZE) < 0) {
#define VHD_BLOCK_SIZE (4096 * VHD_SECTOR_SIZE) /* 2MB blocks */
_Static_assert(sizeof(struct vhd_footer) == VHD_SECTOR_SIZE,