Received: from eggs.gnu.org ([2001:4830:134:3::10]:58533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjo0t-0004kb-RL for qemu-devel@nongnu.org; Tue, 13 Sep 2016 09:44:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjo0o-0006YL-2F for qemu-devel@nongnu.org; Tue, 13 Sep 2016 09:44:38 -0400 From: Markus Armbruster References: <1473442921-2968-1-git-send-email-berrange@redhat.com> Date: Tue, 13 Sep 2016 15:44:21 +0200 In-Reply-To: <1473442921-2968-1-git-send-email-berrange@redhat.com> (Daniel P. Berrange's message of "Fri, 9 Sep 2016 18:41:55 +0100") Message-ID: <874m5j7w3u.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 0/6] Stable output of blockdev format specific info List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, "Dr . David Alan Gilbert" , Paolo Bonzini "Daniel P. Berrange" 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.