From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVjvT-0007a6-ND for qemu-devel@nongnu.org; Fri, 26 Apr 2013 10:47:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVjvR-0007fS-O0 for qemu-devel@nongnu.org; Fri, 26 Apr 2013 10:47:03 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:43657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVjvR-0007ex-Hn for qemu-devel@nongnu.org; Fri, 26 Apr 2013 10:47:01 -0400 Received: by mail-wi0-f173.google.com with SMTP id c10so709280wiw.0 for ; Fri, 26 Apr 2013 07:47:00 -0700 (PDT) Date: Fri, 26 Apr 2013 16:46:57 +0200 From: Stefan Hajnoczi Message-ID: <20130426144657.GB7648@stefanha-thinkpad.redhat.com> References: <1366968675-1451-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1366968675-1451-8-git-send-email-xiawenc@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1366968675-1451-8-git-send-email-xiawenc@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [PATCH 7/7] block: dump to monitor for bdrv_snapshot_dump() and bdrv_image_info_dump() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Wenchao Xia Cc: kwolf@redhat.com, phrdina@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, lcapitulino@redhat.com, pbonzini@redhat.com On Fri, Apr 26, 2013 at 05:31:15PM +0800, Wenchao Xia wrote: > @@ -2586,10 +2585,12 @@ void do_info_snapshots(Monitor *mon, const QDict *qdict) > } > > if (total > 0) { > - monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), NULL)); > + bdrv_snapshot_dump(NULL); > + monitor_printf(mon, "\n"); Luiz: any issue with mixing monitor_printf(mon) and monitor_vprintf(cur_mon) calls? I guess there was a reason for explicitly passing mon instead of relying on cur_mon. > for (i = 0; i < total; i++) { > sn = &sn_tab[available_snapshots[i]]; > - monitor_printf(mon, "%s\n", bdrv_snapshot_dump(buf, sizeof(buf), sn)); > + bdrv_snapshot_dump(sn); > + monitor_printf(mon, "\n"); > } > } else { > monitor_printf(mon, "There is no suitable snapshot available\n"); > diff --git a/util/qemu-error.c b/util/qemu-error.c > index 08a36f4..a47bf32 100644 > --- a/util/qemu-error.c > +++ b/util/qemu-error.c > @@ -213,3 +213,21 @@ void error_report(const char *fmt, ...) > va_end(ap); > error_printf("\n"); > } > + > +/* > + * Print to current monitor if we have one, else to stdout. It is similar with > + * error_printf(). > + * TODO just like error_vprintf() TODO?