On 2013-10-01 14:32, Max Reitz wrote:
In _img_info, filter out additional information specific to the image
format provided by qemu-img info, since tests designed for multiple
image formats would produce different outputs for every image format
otherwise.

Signed-off-by: Max Reitz <mre...@redhat.com>
Ah, I just noticed I forgot to include a sample of what is to be stripped away, so this will have to do for now:

All existing tests using qemu-img info rely on it not emitting image format specific information. Therefore, this data has to be stripped away.

In a human-readable dump, that information will always be last for each "image information block" (multiple blocks are emitted when looking at the backing file chain). Every block is seperated by an empty line. Therefore, in this case, everything starting with the line "Format specific information:" up to that empty line (or EOF, if it's the last block) has to be stripped.

The JSON dump will always emit "pretty" JSON data. Therefore, the ending brace of every object will be indented as much as the object itself is (and every line in between has more indentation). Thus, in this case, we have to strip all the data beginning with ' *"format-specific": {' until a line ' *},' appears which is indented just as much as the former was.

Hm, now that I think of it… Actually, the ending line is rather ' *},?', since the comma is "optional", depending on whether it is the last object or not. Well, I think this calls for v7, then. I'll include this description in patch v7 5/6.

Max

Reply via email to