"Daniel P. Berrange" <berra...@redhat.com> writes: > This is an update of the bits of this previous > series which were not merged > > https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01723.html > > The problem addressed in this series is that the > 'qemu-img info' command does not have a stable > output format for the image specific info objects. > > The QAPI types are first converted to QDicts, > and then printed with custom code to recurse over > the QDicts. This causes information about the object > field ordering to be thrown away, and fields are > printed in whatever order they appear in the QDict > hash buckets. This is not a big deal historically > since none of the image formats had nested data > structures, but with the LUKS blockdev this style > of random ordering looks very unpleasant.
QDict could be changed to support iteration in insertion order. > To address this, the patch series introduces a > TextOutputVisitor class that is designed to be > able to print out arbitrarily nested QAPI types > directly, What order does it use? > in a format that is identical to that > currently used with 'qemu-img info'. Consult > the patch in question to actually see the output > format, and compare test-string-output-visitor.c > with test-text-output-visitor.c to see how we > really do have 2 completely distinct output formats > that don't share any significant characteristics > beyond both being "plain text". I haven't done that, yet, but I take your word for it. Begs the question whether we really *need* two different output formats! I guess we better discuss that in the context of the patch, where we can actually see the formats.