From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53150) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZLRq-0005uw-KB for qemu-devel@nongnu.org; Mon, 06 May 2013 09:27:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZLRl-00032V-SY for qemu-devel@nongnu.org; Mon, 06 May 2013 09:27:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZLN7-0001Uk-V5 for qemu-devel@nongnu.org; Mon, 06 May 2013 09:22:30 -0400 Date: Mon, 6 May 2013 09:22:24 -0400 From: Luiz Capitulino Message-ID: <20130506092224.18dbac32@redhat.com> In-Reply-To: <518710E7.5060103@linux.vnet.ibm.com> References: <1366968675-1451-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1366968675-1451-8-git-send-email-xiawenc@linux.vnet.ibm.com> <20130426144657.GB7648@stefanha-thinkpad.redhat.com> <20130429150541.298db151@redhat.com> <5181C9D4.4000905@linux.vnet.ibm.com> <20130502080206.21df203f@redhat.com> <51832636.1020900@linux.vnet.ibm.com> <518710E7.5060103@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, Stefan Hajnoczi , qemu-devel@nongnu.org, armbru@redhat.com, pbonzini@redhat.com On Mon, 06 May 2013 10:09:43 +0800 Wenchao Xia wrote: > =E4=BA=8E 2013-5-3 10:51, Wenchao Xia =E5=86=99=E9=81=93: > > =E4=BA=8E 2013-5-2 20:02, Luiz Capitulino =E5=86=99=E9=81=93: > >> On Thu, 02 May 2013 10:05:08 +0800 > >> Wenchao Xia wrote: > >> > >>> =E4=BA=8E 2013-4-30 3:05, Luiz Capitulino =E5=86=99=E9=81=93: > >>>> On Fri, 26 Apr 2013 16:46:57 +0200 > >>>> Stefan Hajnoczi wrote: > >>>> > >>>>> 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. > >>>> > >>>> where are they being mixed? > >>>> > >>> bdrv_snapshot_dump() used a global variable "cur_mon" inside, > >>> instead > >>> of let caller pass in a explicit montior* "mon", I guess that is the > >>> question. > >> > >> I'd have to see the code to tell, but yes, what Stefan described is the > >> best practice for the Monitor. > >> > > I think this would not be a problem until qemu wants more than one > > human monitor console, and then we may require a data structure to tell > > where to output the string: stdout, *mon, or even stderr, and > > error_printf() also need to be changed. > > > Luiz, what is your idea? I'd like to respin v2 if no issues for it. As I said before, I'd have to see the code to tell. But answering your comm= ent, the code does support multiple monitors.