qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: pbonzini@redhat.com, Luiz Capitulino <lcapitulino@redhat.com>,
	qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2 06/14] qapi: Add qstring_append_format()
Date: Wed, 23 Dec 2015 16:31:29 +0800	[thread overview]
Message-ID: <20151223083129.GJ14423@ad.usersys.redhat.com> (raw)
In-Reply-To: <1450744268-25052-7-git-send-email-eblake@redhat.com>

On Mon, 12/21 17:31, Eric Blake wrote:
> Back in commit 764c1ca (Nov 2009), we added qstring_append_int().
> However, it did not see any use until commit 190c882 (Jan 2015).
> Furthermore, it has a rather limited use case - to print anything
> else, callers still have to format into a temporary buffer, unless
> we want to introduce an explosion of new qstring_append_* methods
> for each useful type to print.
> 
> A much better approach is to add a wrapper that merges printf
> behavior onto qstring_append, via the new qstring_append_format()
> (and its vararg counterpart).  In fact, with that in place, we
> no longer need qstring_append_int().
> 
> Other immediate uses for the new function include simplifying
> two existing clients of qstring_append() on a just-formatted
> buffer, and the fact that we can take advantage of printf width
> manipulations for more efficient indentation.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2015-12-23  8:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-22  0:30 [Qemu-devel] [PATCH v2 00/14] Add qapi-to-JSON output visitor Eric Blake
2015-12-22  0:30 ` [Qemu-devel] [PATCH v2 01/14] qapi: Rename (one) qjson.h to qobject-json.h Eric Blake
2015-12-22  0:30 ` [Qemu-devel] [PATCH v2 02/14] qapi: Improve use of qmp/types.h Eric Blake
2015-12-23  7:14   ` Fam Zheng
2015-12-22  0:30 ` [Qemu-devel] [PATCH v2 03/14] qapi: Factor out JSON string escaping Eric Blake
2015-12-23  7:20   ` Fam Zheng
2015-12-22  0:30 ` [Qemu-devel] [PATCH v2 04/14] qapi: Factor out JSON number formatting Eric Blake
2015-12-23  7:32   ` Fam Zheng
2015-12-22  0:30 ` [Qemu-devel] [PATCH v2 05/14] qapi: Use qstring_append_chr() where appropriate Eric Blake
2015-12-23  7:32   ` Fam Zheng
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 06/14] qapi: Add qstring_append_format() Eric Blake
2015-12-23  8:31   ` Fam Zheng [this message]
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 07/14] qapi: add json output visitor Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 08/14] qjson: Simplify by using json-output-visitor Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 09/14] Revert "qjson: Simplify by using json-output-visitor" Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 10/14] vmstate: use new JSON output visitor Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 11/14] qjson: Remove unused file Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 12/14] qapi: Add qobject_to_json_pretty_prefix() Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 13/14] qapi: Support pretty printing in JSON output visitor Eric Blake
2015-12-23  9:24   ` Fam Zheng
2015-12-23 16:27     ` Eric Blake
2015-12-22  0:31 ` [Qemu-devel] [PATCH v2 14/14] qemu-img: Use new JSON output formatter Eric Blake
2015-12-23 20:57 ` [Qemu-devel] [PATCH v2 00/14] Add qapi-to-JSON output visitor Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151223083129.GJ14423@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).