|
From: | Max Reitz |
Subject: | Re: [Qemu-devel] [PATCH v6 5/6] qemu-iotests: Discard specific info in _img_info |
Date: | Tue, 01 Oct 2013 14:47:17 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
On 2013-10-01 14:32, Max Reitz wrote:
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: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 <address@hidden>
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
[Prev in Thread] | Current Thread | [Next in Thread] |