summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-08-18 00:29:07 +0200
committerPeter Wu <peter@lekensteyn.nl>2014-12-23 13:04:02 +0100
commit24767a88a094ea21b0796f70c555f6f9b986b386 (patch)
tree44bfd9d8f728cdcce20e7ce6d0dd320f8e71bc8f
parent45e1611de8be0eae55967694dd6e627c2dc354f2 (diff)
downloadqemu-24767a88a094ea21b0796f70c555f6f9b986b386.tar.gz
block/dmg: document UDIF trailer offset
It was not immediately obvious why 0x1d8 was subtracted. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
-rw-r--r--block/dmg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/dmg.c b/block/dmg.c
index e455886d2b..46a8a5a8b1 100644
--- a/block/dmg.c
+++ b/block/dmg.c
@@ -151,9 +151,11 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags,
ret = offset;
goto fail;
}
- offset -= 0x1d8;
+ /* go the beginning of the UDIF trailer */
+ offset -= 0x200;
- ret = read_uint64(bs, offset, &info_begin);
+ /* offset of resource fork (RsrcForkOffset) */
+ ret = read_uint64(bs, offset + 0x28, &info_begin);
if (ret < 0) {
goto fail;
} else if (info_begin == 0) {