block/dmg: factor out block type check
commita8b10c6ead7f62e8eadbdaf944f371889c3c4c29
authorPeter Wu <peter@lekensteyn.nl>
Tue, 6 Jan 2015 17:48:13 +0000 (6 18:48 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 6 Feb 2015 16:24:21 +0000 (6 17:24 +0100)
tree259678c86c725e2d99b4297f7f94f0efbd772dfd
parent66ec3bba972b6d4433698397d25d039c230949dc
block/dmg: factor out block type check

In preparation for adding bzip2 support, split the type check into a
separate function. Make all offsets relative to the begin of a chunk
such that it is easier to recognize the position without having to
add up all offsets. Some comments are added to describe the fields.

There is no functional change.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1420566495-13284-11-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