Skip to content
  • yuchenlin's avatar
    vmdk: align end of file to a sector boundary · 51b3c6b7
    yuchenlin authored
    
    
    There is a rare case which the size of last compressed cluster
    is larger than the cluster size, which will cause the file is
    not aligned at the sector boundary.
    
    There are three reasons to do it. First, if vmdk doesn't align at
    the sector boundary, there may be many undefined behaviors,
    such as, in vbox it will show VMDK: Compressed image is corrupted
    'syno-vm-disk1.vmdk' (VERR_ZIP_CORRUPTED) when we try to import an
    ova with unaligned vmdk. Second, all the cluster_sector is aligned
    to sector, the last one should be like this, too. Third, it ease
    reading with sector based I/Os.
    
    Signed-off-by: default avataryuchenlin <yuchenlin@synology.com>
    Message-Id: <20180913082952.3675-1-yuchenlin@synology.com>
    Reviewed-by: default avatarFam Zheng <famz@redhat.com>
    Signed-off-by: default avatarFam Zheng <famz@redhat.com>
    51b3c6b7