From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ugzla-0005og-QC for qemu-devel@nongnu.org; Mon, 27 May 2013 11:55:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UgzlV-0006HC-7Z for qemu-devel@nongnu.org; Mon, 27 May 2013 11:55:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UgzlU-0006H2-Vu for qemu-devel@nongnu.org; Mon, 27 May 2013 11:55:17 -0400 Date: Mon, 27 May 2013 11:55:11 -0400 From: Luiz Capitulino Message-ID: <20130527115511.68a75feb@redhat.com> In-Reply-To: <20130527154059.GG2373@dhcp-200-207.str.redhat.com> References: <1369451385-23452-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1369451385-23452-5-git-send-email-xiawenc@linux.vnet.ibm.com> <20130527110238.289c9dc7@redhat.com> <20130527154059.GG2373@dhcp-200-207.str.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH V3 4/4] block: dump snapshot and image info to specified output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: phrdina@redhat.com, stefanha@gmail.com, armbru@redhat.com, qemu-devel@nongnu.org, pbonzini@redhat.com, Wenchao Xia On Mon, 27 May 2013 17:40:59 +0200 Kevin Wolf wrote: > Am 27.05.2013 um 17:02 hat Luiz Capitulino geschrieben: > > On Sat, 25 May 2013 11:09:45 +0800 > > Wenchao Xia wrote: > > > > > bdrv_snapshot_dump() and bdrv_image_info_dump() do not dump to a buffer now, > > > some internal buffers are still used for format control, which have no > > > chance to be truncated. As a result, these two functions have no more issue > > > of truncation, and they can be used by both qemu and qemu-img with correct > > > parameter specified. > > > > > > Signed-off-by: Wenchao Xia > > > > I don't like the casting and the void pointers very much, but I can't > > suggest anything better: > > Maybe introduce and use a different function pointer type that > explicitly takes void* instead of FILE*. You'd still have to cast the > function pointers (and now actually in all instances), but then at least > nobody can accidentally misinterpret a Monitor* as FILE*. I'm not sure this helps much because we'd have two functions pointers to choose (which fails the purpose of having the function pointer IMO) and also, there's code in QEMU doing this cast/void dance already. If we want a good solution, we'd have to find a better way to print to the monitor and to standard output.