summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-12-26 22:17:05 +0100
committerPeter Wu <peter@lekensteyn.nl>2014-12-26 22:17:05 +0100
commitb8ca40759c5099628974d01284319c06a77840f7 (patch)
treec83eb9752c4a15585f9e45d0489147018b94d9b3 /docs
parent45e1611de8be0eae55967694dd6e627c2dc354f2 (diff)
downloadqemu-b8ca40759c5099628974d01284319c06a77840f7.tar.gz
block/dmg: properly detect the UDIF trailer
DMG files have a variable length with a UDIF trailer at the end of a file. This UDIF trailer is essential as it describes the contents of the image. At the moment however, the start of this trailer is almost always incorrect as bdrv_getlength() returns a multiple of the block size (rounded up). This results in a failure to recognize DMG files, resulting in Invalid argument (EINVAL) errors. As there is no API to retrieve the real file size, look for the magic header in the last two sectors to find the start of this 512-byte UDIF trailer (the "koly" block). The resource fork offset ("info_begin") has its offset adjusted as the initial value of offset does not mean "end of file" anymore, but "begin of UDIF trailer". Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions