parallels: 2TB+ parallels images support
commitd25d59802021a747812472780d80a0e792078f40
authorDenis V. Lunev <den@openvz.org>
Mon, 28 Jul 2014 16:23:55 +0000 (28 20:23 +0400)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 15 Aug 2014 17:03:13 +0000 (15 18:03 +0100)
tree24e1591d13ea8d5d1cc9e492150e3f30639d992e
parent418a7adb77abbbc09a17d5626cbaa5e9e54be709
parallels: 2TB+ parallels images support

Parallels has released in the recent updates of Parallels Server 5/6
new addition to his image format. Images with signature WithouFreSpacExt
have offsets in the catalog coded not as offsets in sectors (multiple
of 512 bytes) but offsets coded in blocks (i.e. header->tracks * 512)

In this case all 64 bits of header->nb_sectors are used for image size.

This patch implements support of this for qemu-img and also adds specific
check for an incorrect image. Images with block size greater than
INT_MAX/513 are not supported. The biggest available Parallels image
cluster size in the field is 1 Mb. Thus this limit will not hurt
anyone.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Jeff Cody <jcody@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/parallels.c