]> git.proxmox.com Git - mirror_qemu.git/commit - block/dmg.c
block/dmg: use SectorNumber from BLKX header
authorPeter Wu <peter@lekensteyn.nl>
Tue, 6 Jan 2015 17:48:12 +0000 (18:48 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 6 Feb 2015 16:24:21 +0000 (17:24 +0100)
commit66ec3bba972b6d4433698397d25d039c230949dc
treeeb2bbd886a40e7f46a8e7ab768381fe6d2049174
parentc6d34865fa02463cf34634f45369ebcc725b101b
block/dmg: use SectorNumber from BLKX header

Previously the sector table parsing relied on the previous offset of
the DMG file. Now it uses the sector number from the BLKX header
(see http://newosxbook.com/DMG.html).

The implementation of dmg2img (from vu1tur) does not base the output
sector on the location of the terminator (0xffffffff) either so it
should be safe to drop this dependency on the previous state.

(It makes somehow makes sense, a terminator should halt further
processing of a block and is perhaps used to preallocate some space.)

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1420566495-13284-10-git-send-email-peter@lekensteyn.nl
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/dmg.c